Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tightly packed table. Problem with Firefox / XHTML Strict. 1

Status
Not open for further replies.

lenrobert

Programmer
Feb 24, 2005
13
GB
I would like to use a table to keep images, without any
gaps between them. I could not do it with Firefox using
XHTML Strict declaration.

To make the gaps visible I used red background color.
Can anyone help?

Tip: Maybe it has some thing to do with the font-size.
The red strip's height changes as the font-size changes:
from 4pt to 5pt or from 6pt to 7pt.

Here is the code. You will need a 17x17 image to use it.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<meta http-equiv="Content-Language" content="hu" />

<style type="text/css">
.KeptartoTABLE { 
  border-style:none;

}

.KeptartoTH, .KeptartoTD { 
  padding:0; border-style:none; 
  background-color: red; font-family:Arial; font-size:7pt;
}

img {
  margin:0; padding:0; border-style:none;
}
</style>

<title>CSS Question</title>
</head>
<body>
<!-- Maybe it has some thing to do with the font-size.
The red strip's height changes as the font-size changes:
 from 4pt to 5pt or from 6pt to 7pt. -->

<table cellspacing="0" class="KeptartoTABLE">
<tr class="KeptartoTH"><td class="KeptartoTD"><img src="fel.gif" alt="novel" width="17" height="17"/></td></tr>
<tr class="KeptartoTH"><td class="KeptartoTD"><img src="fel.gif" alt="novel" width="17" height="17"/></td></tr>
</table>
    
</body></html>
 

Given that the cells have no text in them, I would remove these two lines:

Code:
font-family:Arial;
font-size:7pt;

To fix the issue you're seeing, add this line to the TD style:

Code:
line-height:1px;

Hope this helps,
Dan



[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Dear Dan!

It works fine. Thank you for your quick and valuable answer.

Robert
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top