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 Friendly4 Lessons - Free course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.Beginner Friendly11 Lessons - Free course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner Friendly6 Lessons