Grokking CSS for Web Development
Vote

0% completed

​

Text alignment

Setting text-align: center on a 420px-wide article does not move the article anywhere. The box stays exactly where it was, and only the lines of text inside it shift. That behavior explains everything about text-align: it decides where each line of text sits within the width of its own box, and it never moves the box.

The recipe article from the previous lesson now has a fixed width of 420px, so its lines wrap at the same places on every screen. A fixed width this wide would overflow a phone screen; Chapter 11 shows how to make widths flexible

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content