Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

why should I use display:block ?

I have already use "text-align : center " to keep wording in the center.

But it didn't work till I add "display:block".

I don't figure out why should I add this to make the content centered.

1 Answer

Im not a 100% sure. But i think it creates a block around the text, so that you can create a background around the whole instead of the text alone. Makes making navigation bars easier.

Makes it easier to do padding and margin and stuff.