HighDots Forums  

h1 tag problem? why?

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss h1 tag problem? why? in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Simon
 
Posts: n/a

Default h1 tag problem? why? - 12-16-2003 , 05:28 PM






Hi,

Can anybody tell me how I stop the extra space my heading tags produce under
the text.
The space the tag is producing is throwing my layout out alot and I cant
figure how to remove it. If I change the line height ..the top of the text
is cut off...how do I do this?

Any advice is much appreciated

Sy



Reply With Quote
  #2  
Old   
Fabian Neumann
 
Posts: n/a

Default Re: h1 tag problem? why? - 12-16-2003 , 05:45 PM






Am 16.12.2003 23:28 schrieb Simon:
Quote:
Hi,

Can anybody tell me how I stop the extra space my heading tags produce under
the text.
This should solve your problem:

h1 {
margin-bottom:0;
}

To remove any default whitespace use:

h1 {
padding:0;
margin:0;
}

Fabian


Reply With Quote
  #3  
Old   
Arne
 
Posts: n/a

Default Re: h1 tag problem? why? - 12-16-2003 , 05:48 PM




"Simon" <simon (AT) digink (DOT) co.uk> skrev i meddelandet
news:2GLDb.2207$2r4.1066 (AT) newsfep3-gui (DOT) server.ntli.net...
Quote:
Hi,

Can anybody tell me how I stop the extra space my heading tags produce
under
the text.
The space the tag is producing is throwing my layout out alot and I
cant
figure how to remove it. If I change the line height ..the top of the
text
is cut off...how do I do this?

Any advice is much appreciated

Try <H1 style="-5px;"> (negativ value)
But I don't know for sure how it validates or works in all browsers.

--
/Arne



Reply With Quote
  #4  
Old   
Arne
 
Posts: n/a

Default Re: h1 tag problem? why? - 12-16-2003 , 06:06 PM




"brucie" <brucie01 (AT) bruciesusenetshit (DOT) info> skrev i meddelandet
news:bro251$5l0k6$1 (AT) ID-117621 (DOT) news.uni-berlin.de...
Quote:
in post <news:2GLDb.2207$2r4.1066 (AT) newsfep3-gui (DOT) server.ntli.net
Simon said:

Can anybody tell me how I stop the extra space my heading tags
produce under
the text.

margin-bottom:0;

I belive you must use a negative value to get it realy "tight", i.e
margin-bottom:-5px;

--
/Arne




Reply With Quote
  #5  
Old   
Anne van Kesteren
 
Posts: n/a

Default Re: h1 tag problem? why? - 12-17-2003 , 02:35 AM



Arne wrote:
Quote:
I belive you must use a negative value to get it realy "tight", i.e
margin-bottom:-5px;
No, that is stupid, since you could pull the element below over the H1
element. You should only use negative margins to 'design' not to remove
whitespace.


--
Anne van Kesteren
<http://www.annevankesteren.nl/>


Reply With Quote
  #6  
Old   
Anne van Kesteren
 
Posts: n/a

Default Re: h1 tag problem? why? - 12-17-2003 , 02:36 AM



Arne wrote:
Quote:
Try <H1 style="-5px;"> (negativ value)
But I don't know for sure how it validates or works in all browsers.
This isn't the way to do it.

h1{
margin:0;
padding:0;
}

Is the way to go, as explained in other mails.


--
Anne van Kesteren
<http://www.annevankesteren.nl/>


Reply With Quote
  #7  
Old   
Arne
 
Posts: n/a

Default Re: h1 tag problem? why? - 12-17-2003 , 05:58 AM




"Anne van Kesteren" <mail (AT) annevankesteren (DOT) nl> skrev i meddelandet
news:brp1ba$7hd$1 (AT) reader08 (DOT) wxs.nl...
Quote:
Arne wrote:
I belive you must use a negative value to get it realy "tight", i.e
margin-bottom:-5px;

No, that is stupid, since you could pull the element below over the H1
element. You should only use negative margins to 'design' not to
remove
whitespace.


I don't say you are wrong, but at least it works fine for me, tested
with IE 6.xx and Netscape 7.xx
Don't know about Opera and other.
--
/Arne




Reply With Quote
  #8  
Old   
Simon
 
Posts: n/a

Default Re: h1 tag problem? why? - 12-17-2003 , 06:48 AM




"Anne van Kesteren" <mail (AT) annevankesteren (DOT) nl> wrote

Quote:
Arne wrote:
Try <H1 style="-5px;"> (negativ value)
But I don't know for sure how it validates or works in all browsers.

This isn't the way to do it.

h1{
margin:0;
padding:0;
}

Is the way to go, as explained in other mails.


--
Anne van Kesteren
http://www.annevankesteren.nl/

Thankyou Everyone

Sy




Reply With Quote
  #9  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: h1 tag problem? why? - 12-18-2003 , 03:16 PM



"Arne" <arne.luras (AT) telia (DOT) com> wrote:

Quote:
I belive you must use a negative value to get it realy "tight",
i.e margin-bottom:-5px;

No, that is stupid, since you could pull the element below over
the H1 element. You should only use negative margins to 'design'
not to remove whitespace.

I don't say you are wrong, but at least it works fine for me,
tested with IE 6.xx and Netscape 7.xx
It depends on your definition of "works". A negative bottom margin
means that the elements will partly overprint each other, if the next
element's top margin is zero. What this means depends on the context.
Making text lines touch (or even overprint) is usually not a good idea.

But maybe you mean that the next element has a nonzero margin. Then
that's the issue you should consider. Negative margins are a somewhat
clumsy way of addressing that problem.

--
Yucca, http://www.cs.tut.fi/~jkorpela/


Reply With Quote
  #10  
Old   
Neal
 
Posts: n/a

Default Re: h1 tag problem? why? - 12-19-2003 , 11:05 AM




"Arne" <arne.luras (AT) telia (DOT) com> wrote

Quote:
Can anybody tell me how I stop the extra space my heading tags
produce under
the text.

margin-bottom:0;


I belive you must use a negative value to get it realy "tight", i.e
margin-bottom:-5px;
Corect me if I'm wrong. Please.

But doesn't the UA only use the largest margin of the two when vertically
aligning block elements? So as long as you have a margin of 0, the margin
that occurs will be the one set or default for the other element (in this
case, a p seemingly)?




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.