Welcome to WebmasterWorld Guest from 54.160.131.144

Forum Moderators: not2easy

Message Too Old, No Replies

Using H1 without next line space

Through CSS

     

henry0

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

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



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

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

WebmasterWorld Senior Member 10+ Year Member



try

h1 {
margin-bottom:0px;
}

and:

p{
margin-top:0px;
}

:)

henry0

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

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



Done!
Thank you

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

mrowton

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

10+ Year Member



I've always used:

h1 {
display:inline;
}

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

benihana

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

WebmasterWorld Senior Member 10+ Year Member



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

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

10+ Year Member



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

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

WebmasterWorld Senior Member 10+ Year Member



Good idea Sathallrin. I do similar, using:

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

createErrorMsg

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

WebmasterWorld Senior Member 10+ Year Member



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

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

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



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