Welcome to WebmasterWorld Guest from 54.198.200.157

Forum Moderators: not2easy

Message Too Old, No Replies

question about <h1> tag in css

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

New User

10+ Year Member

joined:July 7, 2002
posts:33
votes: 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

Mak

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

Senior Member

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

joined:Feb 4, 2002
posts:5044
votes: 0


Hi Welcome to WebmasterWorld [webmasterworld.com]

[webmasterworld.com...]

Msg 5 is what you need!

Nick

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

Senior Member

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

joined:May 26, 2000
posts:37301
votes: 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)

New User

10+ Year Member

joined:July 7, 2002
posts:33
votes: 0


thanks

Nick_W and Tedster

Mak

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

Senior Member

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

joined:Feb 17, 2002
posts:3318
votes: 0


h1
{
display: inline;
}

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

Anne

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members