homepage Welcome to WebmasterWorld Guest from 23.23.22.200
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderator: open

CSS Forum

    
Using H1 without next line space
Through CSS
henry0




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

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

 

benihana




msg:1185233
 2:50 pm on Sep 21, 2005 (gmt 0)

try

h1 {
margin-bottom:0px;
}

and:

p{
margin-top:0px;
}

:)

henry0




msg:1185234
 3:06 pm on Sep 21, 2005 (gmt 0)

Done!
Thank you

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

mrowton




msg:1185235
 3:12 pm on Sep 21, 2005 (gmt 0)

I've always used:

h1 {
display:inline;
}

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

benihana




msg:1185236
 3:17 pm on Sep 21, 2005 (gmt 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...:)

Sathallrin




msg:1185237
 1:59 pm on Sep 22, 2005 (gmt 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.

benihana




msg:1185238
 2:03 pm on Sep 22, 2005 (gmt 0)

Good idea Sathallrin. I do similar, using:

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

createErrorMsg




msg:1185239
 2:52 pm on Sep 22, 2005 (gmt 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

henry0




msg:1185240
 7:28 pm on Sep 22, 2005 (gmt 0)

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

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