Help - Search - Members - Calendar
Full Version: Remove Heading line breaks
HTMLHelp Forums > Web Authoring > Cascading Style Sheets
thehodapp
I understand that headings place line breaks before and after the heading text. My question is how can I remove the line breaks using CSS?

I tried setting margins, padding, and line-height to 0, but that didn't work. I can't figure out what style property to use.
Christian J
Headings are styled as block level elements by default. Try changing to inline.

If the heading is followed by a e.g. P element that must be made inline too.
Darin McGrew
You need to set margin and padding to 0, but you need to do that both for the bottom margin and padding of the heading, and for the top margin and padding for the element that follows the heading.
thehodapp
Thanks very much. I think I've got it figured out.

It had to do with the block level nature of the heading so I set it to inline and then put a <br /> before it.

I guess it works...
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.