Welcome to WebmasterWorld Guest from 54.242.224.250

Forum Moderators: not2easy

Message Too Old, No Replies

Using H1 without next line space

Through CSS

     
2:45 pm on Sep 21, 2005 (gmt 0)

Senior Member from US 

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

joined:Apr 19, 2003
posts:4397
votes: 2


My <h1> are governed by CSS
h1{etc....;}

I always wondered if there is a way to get rid of the "H something.." space (like a <P>) that invariably follows the <H1> delimited area?</H1>

For ex:
H1 line
Automatic Space - That I would like getting rid of -
Rest of text

Am I missing something, can it be done?
thanks

2:50 pm on Sept 21, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Jan 13, 2003
posts:1240
votes: 0


try

h1 {
margin-bottom:0px;
}

and:

p{
margin-top:0px;
}

:)

3:06 pm on Sept 21, 2005 (gmt 0)

Senior Member from US 

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

joined:Apr 19, 2003
posts:4397
votes: 2


Done!
Thank you

The power of WebmasterWorld's members at his best. :)

3:12 pm on Sept 21, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Feb 4, 2005
posts:47
votes: 0


I've always used:

h1 {
display:inline;
}

Perhaps one of these methods is depreciated? Going to look now...

3:17 pm on Sept 21, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Jan 13, 2003
posts:1240
votes: 0


no, not deprecated.

using margins leaves the h1 as a block level element, which i prefer, so as not to have to worry about any following inline elements that maybe nudge up next to it. Its up to you though...:)

1:59 pm on Sept 22, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:June 16, 2005
posts:89
votes: 0


I usually start off the CSS with something like:
h1,h2,h3,h4,h5,h6,p {margin:0;}

And then specify the magrins on the items as I need them. This is because I have noticed that different browsers set the default margins on the items differently, and I prefer them to render the same under different browsers.
2:03 pm on Sept 22, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Jan 13, 2003
posts:1240
votes: 0


Good idea Sathallrin. I do similar, using:

* {
margin:0;
padding:0;
}
to zero everything.:)

2:52 pm on Sept 22, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 6, 2004
posts:2239
votes: 0


display:inline;

Display inline also removes your ability to control the dimensions of the header, as only block level elements can take widths or heights.

cEM

7:28 pm on Sept 22, 2005 (gmt 0)

Senior Member from US 

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

joined:Apr 19, 2003
posts:4397
votes: 2


I still use a table so margin and padding are part of table definition
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members