Welcome to WebmasterWorld Guest from 54.211.101.8

Forum Moderators: not2easy

question about <h1> tag in css

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

10+ Year Member



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

Mak

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

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Hi Welcome to WebmasterWorld [webmasterworld.com]

[webmasterworld.com...]

Msg 5 is what you need!

Nick

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

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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)

10+ Year Member



thanks

Nick_W and Tedster

Mak

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

WebmasterWorld Senior Member annej is a WebmasterWorld Top Contributor of All Time 10+ Year Member



h1
{
display: inline;
}

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

Anne

 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month