strange padding/margin around images in Firefox

H

Hans Nieser

I have recently started using XHTML 1.0 Strict and table-less layouts
(except for displaying tabular data ofcourse). I'm quite pleased with
the results in terms of cross browser compatibility and my HTML looks a
hell of a lot cleaner this way.

However I've run into an issue where I get some kind of padding or
margin around images in Mozila Firefox and it seems impossible for me
to remove them. Example page is online here:

http://www.aphax.nl/files/htmlstuff/01.html
http://www.aphax.nl/files/htmlstuff/01/styles/default.css

The problem is the vertical space between the top header image
(header_top.png) and the bunch of images (header_bottom_*.png &
tabs_*.png) below it, that form the lower part of the header and the
tabbar. I've tried all sorts of things ranging from putting everything
in DIVs to explicitly setting margin and padding to 0 px on all elements
involved to no avail.

Even though it looks just fine in Internet Explorer, I'm going to assume
here that Firefox isn't to blame, but rather my incomplete understanding
of XHTML/CSS.

Can anyone tell me what is going on here?, and/or perhaps give me any
ideas on other ways to deal with this without having to revert to using
tables?

Thanks in advance,

Hans
 
J

Jim Higson

Hans said:
I have recently started using XHTML 1.0 Strict and table-less layouts
(except for displaying tabular data ofcourse). I'm quite pleased with
the results in terms of cross browser compatibility and my HTML looks a
hell of a lot cleaner this way.

However I've run into an issue where I get some kind of padding or
margin around images in Mozila Firefox and it seems impossible for me
to remove them. Example page is online here:

http://www.aphax.nl/files/htmlstuff/01.html
http://www.aphax.nl/files/htmlstuff/01/styles/default.css

The problem is the vertical space between the top header image
(header_top.png) and the bunch of images (header_bottom_*.png &
tabs_*.png) below it, that form the lower part of the header and the
tabbar. I've tried all sorts of things ranging from putting everything
in DIVs to explicitly setting margin and padding to 0 px on all elements
involved to no avail.

Even though it looks just fine in Internet Explorer, I'm going to assume
here that Firefox isn't to blame, but rather my incomplete understanding
of XHTML/CSS.

Can anyone tell me what is going on here?, and/or perhaps give me any
ideas on other ways to deal with this without having to revert to using
tables?

Thanks in advance,

Hans

Hmmm... maybe the <br /> imbetween your images looks to blaim? Thy just
letting the images wrap natuarally.
 
H

Hans Nieser

Jim said:
Hans Nieser wrote:
Hmmm... maybe the <br /> imbetween your images looks to blaim? Thy just
letting the images wrap natuarally.

Tried that, didn't fix it unfortunately. I'm pretty much out of ideas on
what to try (hell, I'm even considering using tables again).
 
H

Hans Nieser

Hans said:
I have recently started using XHTML 1.0 Strict and table-less layouts
(except for displaying tabular data ofcourse). I'm quite pleased with
the results in terms of cross browser compatibility and my HTML looks a
hell of a lot cleaner this way.

However I've run into an issue where I get some kind of padding or
margin around images in Mozila Firefox and it seems impossible for me to
remove them. Example page is online here:

http://www.aphax.nl/files/htmlstuff/01.html
http://www.aphax.nl/files/htmlstuff/01/styles/default.css

The problem is the vertical space between the top header image
(header_top.png) and the bunch of images (header_bottom_*.png &
tabs_*.png) below it, that form the lower part of the header and the
tabbar. I've tried all sorts of things ranging from putting everything
in DIVs to explicitly setting margin and padding to 0 px on all elements
involved to no avail.

Even though it looks just fine in Internet Explorer, I'm going to assume
here that Firefox isn't to blame, but rather my incomplete understanding
of XHTML/CSS.

Can anyone tell me what is going on here?, and/or perhaps give me any
ideas on other ways to deal with this without having to revert to using
tables?

Found a solution. I set "line-height: 0px" on the containing div element
and the padding/margin is gone.
 

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,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top