homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

question about <h1> tag in css

 10:00 pm on Apr 23, 2003 (gmt 0)

I'm redifining the <h1> tag in a style sheet to reduce it's size, howevewr one property of the <h1> tag is to force a double line break much like the <p> tag

can I change this so that I can have the body text begin in the next line to the <h1> text




 10:07 pm on Apr 23, 2003 (gmt 0)

Hi Welcome to WebmasterWorld [webmasterworld.com]


Msg 5 is what you need!



 10:14 pm on Apr 23, 2003 (gmt 0)

Another approach that doesn't involve undoing the block character of the tag is to deal with two things: the margin-bottom of the <H1> and the margin-top of whatever element follows it, often a <p>.

The margin collapsing rules state that whichever margin is the larger will be the rendered space between the elements. And it's margins, not just line breaks, that you're seeing in the default behavior of H tags.

To get the following copy to butt right up against the header, both margins should be zero, although I prefer just a few extra pixels in there.


 10:26 pm on Apr 23, 2003 (gmt 0)


Nick_W and Tedster



 3:56 pm on Apr 25, 2003 (gmt 0)

display: inline;

I was just struggling with this yesterday and here was the answer. What a great forum. Thanks.


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved