CSS: remove gap under image

R

Roy Schestowitz

chlori said:
Hi

There is a gap under the logo image (IE6/FF1):
http://www.arto.ch/tests/thinklab/index2.php

How can I remove it?

(The image is just an ugly dummy image...)

Try adding a margin or padding attribute to the <p id="logo"> element, e.g.
style="margin-bottom: 0px; padding-bottom: 0px". I am not sure about the
names here, but it's the idea I hope to get across.

Roy
 
S

Steve Pugh

chlori said:
There is a gap under the logo image (IE6/FF1):
http://www.arto.ch/tests/thinklab/index2.php

How can I remove it?

The <h1> has position relative. Remove that and add borders to the
<h1>. What do you see? The bottom border of the <h1> coincides with
the top of the nav strip.

When you use position: relative the rest of the page is laid out as if
that element had been in its static position.

You've given the h1 a line-height of 60px so it has to be 10px taller
than the 50px tall image. Hence there will be at least a 10px gap.

Setting a pixel line-height is a bad idea - it causes problems when
the font size is larger than that pixel value.

Remove the line-height and the gap becomes much smaller.

The remaining gap is due to the fact that images are treated as text
and sit on the baseline of their line box. In this case this means
that <p id="logo"> (BTW is that really a paragraph?) has space below
the baseline just as it would if there was text in there. Set display:
block for the logo <img> to remove.

Steve
 
C

chlori

Steve Pugh schrieb am 20.01.2005 12:19:
Remove the line-height and the gap becomes much smaller.
Worked...

<p id="logo"> (BTW is that really a paragraph?)

No, but the validator didn't like the image standing
there alone when I changed from transitional to strict.

Would a said:
has space below the baseline just as it would if there
was text in there. Set display: block for the logo <img>
to remove.

Thanks Steve!
 
R

Richard

There is a gap under the logo image (IE6/FF1):
http://www.arto.ch/tests/thinklab/index2.php
How can I remove it?
(The image is just an ugly dummy image...)


<h> tags inherently include a break like a paragraph does.
Instead of a <h> use "text-size:14pt".
I prefer pt to px because a font is set up naturally in pt.
Then for your images use img {margin;0px;}
No dot or # before img.
Personally, I like a little seperation between images and text.
 
M

Michael Fesser

.oO(Richard)
<h> tags inherently include a break like a paragraph does.

Like every other block-level element.
Instead of a <h> use "text-size:14pt".

Bigger text doesn't make a heading.
I prefer pt to px because a font is set up naturally in pt.

The results across different browsers/platforms are unpredictable when
using pt in screen stylesheets. What is 1pt on a screen?
Then for your images use img {margin;0px;}

Images don't have margins by default, but since they are inline-level
elements they are positioned on the baseline. Adjusting vertical-align
helps in some cases.

Micha
 
G

ghoul

Richard said:
<h> tags inherently include a break like a paragraph does.
Instead of a <h> use "text-size:14pt".
I prefer pt to px because a font is set up naturally in pt.
Then for your images use img {margin;0px;}
No dot or # before img.
Personally, I like a little seperation between images and text.


sicko
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top