473,385 Members | 2,005 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

h1 tag problem? why?

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
Jul 20 '05 #1
12 6245
Am 16.12.2003 23:28 schrieb Simon:
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
Jul 20 '05 #2

"Simon" <si***@digink.co.uk> skrev i meddelandet
news:2G*****************@newsfep3-gui.server.ntli.net...
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

Jul 20 '05 #3
in post <news:2G*****************@newsfep3-gui.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;

--
brucie
17/December/2003 08:46:05 am kilo
Jul 20 '05 #4

"brucie" <br******@bruciesusenetshit.info> skrev i meddelandet
news:br************@ID-117621.news.uni-berlin.de...
in post <news:2G*****************@newsfep3-gui.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
Jul 20 '05 #5
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.
--
Anne van Kesteren
<http://www.annevankesteren.nl/>
Jul 20 '05 #6
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/>
Jul 20 '05 #7

"Anne van Kesteren" <ma**@annevankesteren.nl> skrev i meddelandet
news:br**********@reader08.wxs.nl...
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
Jul 20 '05 #8

"Anne van Kesteren" <ma**@annevankesteren.nl> wrote in message
news:br**********@reader08.wxs.nl...
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
Jul 20 '05 #9
"Arne" <ar********@telia.com> 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


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/
Jul 20 '05 #10

"Arne" <ar********@telia.com> wrote in message
news:1e********************@newsb.telia.net...
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)?
Jul 20 '05 #11
"Neal" <ne**@spamrcn.com> wrote:
But doesn't the UA only use the largest margin of the two when
vertically aligning block elements?
Not always. When a bottom margin is -5px and the next element's top
margin is 15px, the effective margin is 10px.
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)?


Yes, if is zero or positive. But not when it is negative.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 20 '05 #12

"Jukka K. Korpela" <jk******@cs.tut.fi> wrote in message
news:Xn*****************************@193.229.0.31. ..
"Neal" <ne**@spamrcn.com> wrote:
But doesn't the UA only use the largest margin of the two when
vertically aligning block elements?


Not always. When a bottom margin is -5px and the next element's top
margin is 15px, the effective margin is 10px.
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)?


Yes, if is zero or positive. But not when it is negative.


Wow. That's a little counter-intuitive. But thanks.
Jul 20 '05 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Kostatus | last post by:
I have a virtual function in a base class, which is then overwritten by a function of the same name in a publically derived class. When I call the function using a pointer to the derived class...
117
by: Peter Olcott | last post by:
www.halting-problem.com
18
by: Ian Stanley | last post by:
Hi, Continuing my strcat segmentation fault posting- I have a problem which occurs when appending two sting literals using strcat. I have tried to fix it by writing my own function that does the...
28
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A base class... BaseClass bc = new ChildClass();...
6
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length...
16
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by...
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
0
by: =?Utf-8?B?am8uZWw=?= | last post by:
Hello All, I am developing an Input Methop (IM) for PocketPC / Windows Mobile (PPC/WM). On some devices the IM will not start. The IM appears in the IM-List but when it is selected from the...
1
by: sherifbk | last post by:
Problem description ============== - I have 4 clients and 1 server (SQL server) - 3 clients are Monitoring console 1 client is operation console - Monitoring console collects some data from...
9
by: AceKnocks | last post by:
I am working on a framework design problem in which I have to design a C++ based framework capable of solving three puzzles for now but actually it should work with a general puzzle of any kind and I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.