This forum is now read-only. Please use our new forums! Go to forums
Why can't I text-align property to a hyperlink?
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
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.Beginner friendly,4 LessonsLanguage Fluency - Free Course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.Beginner friendly,11 LessonsLanguage Fluency - Free Course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner friendly,6 LessonsLanguage Fluency