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
Kenny Parewijck
4,602 PointsHow 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!
2 Answers
Damien Watson
27,419 PointsA '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.
Kenny Parewijck
4,602 PointsHi 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!
Damien Watson
27,419 PointsAh cool, I didn't see the 'br'.
Damien Watson
27,419 PointsDamien Watson
27,419 PointsI'm assuming there is something missing from your question. To show tags, use the '& lt;' and '& gt;' without the spaces.