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

How to add a line break into a h1 element? (correctly)

Hello everybody

Could anyone tell me how I add a line break inside an h1 element? I guess I could use a br but I I've read somewhere that this is not css validated?

Thanks!

I'm assuming there is something missing from your question. To show tags, use the '& lt;' and '& gt;' without the spaces.

2 Answers

A 'h1' element is a 'block level' element, similar to a 'p' or 'div'. As it is ok to use a <br> in a 'p' or 'div' I don't see why you can't use one in a 'h1'. This is the way we have always done it.

Hi Damien, This was a question without any code written. I just wondered..

Thanks for the answer, I'll use a br in the future then ;).

Thanks!

Ah cool, I didn't see the 'br'.