Why Can't I Text-align Property To A Hyperlink? - Codecademy
Maybe your like
In this exercise, the link is inside the div, but my text is only centered if I use the text-align property in the div. If I try using it directly on ‘a’ selector, it won’t align my text.
Check screenshot for situation #1, where text-align is in the div: https://www.diigo.com/item/image/4qlwr/gx0p
Situation #2, where text-align is in ‘a’, and text is not centered: https://www.diigo.com/item/image/4qlwr/brvo
Answer 534b9221548c3589f900215a
1 votePermalink
because if you assign the text-align center property to the div, it will align everything inside the div. but if you assign the text-align center to the link, the computer doesn’t know to centralize it. the computer can’t tell where to what element it should centralize.
text-align propertys should always be assigned to div elements, block elements so that the computer knows: the text in this box needs to be centralized. if you assign it to the link, it doesn’t know to which block it should be centralized.
Popular free courses
- Free course
Learn SQL
In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.- Checker DenseBeginner Friendly.4 Lessons
- Free course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.- Checker DenseBeginner Friendly.11 Lessons
- Free course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.- Checker DenseBeginner Friendly.6 Lessons
Tag » A Link Center Css
-
How Can I Center This Link - Css - Stack Overflow
-
How To Create Centered Menu Links - W3Schools
-
How To Center Links In CSS? - Programmers Portal
-
How To Center A Link Using CSS | UHD Ed - Ed Ruiz
-
Center Links In Css Code Example - Code Grepper
-
CSS: Centering Things
-
How To Center A Link In Css?
-
A Link Align Center Css?
-
: L'élément De Texte Centré - MDN Web Docs -
How To Center Link In Middle Of Box - HTML & CSS - SitePoint Forums
-
How To Center Anything With CSS - Align A Div, Text, And More
-
What Is The Best Way To Centre Align Text Over An Image In An Link ...
-
How To Center Text In HTML - Computer Hope
-
Learn CSS Centering - Ahmad Shadeed