PDA

View Full Version : DOCTYPE problem


kag
03-20-2006, 06:15 PM
For the first time I have something that works like I want in IE and not in Firefox.

I reduced the problem to its simplest form - look at http://www.boloxe.com/debug/ . The top and bottom cells (that are holding the lines) should be 1px high. It works fine with IE. But in Firefox the cells are much more than 1px high, and if I force the browser to go in quirks mode (remove the doctype declaration), it looks like I believe it should.

Can anyone explain to me what kind of changes does standard mode applies to the formatting compared to quirks mode?... and why it's not showing up like I think it should (the problem is probably with me and not with the specs).

Thank you in advance for your help, this is a great forum (I read it a lot)!

Bill Posters
03-20-2006, 06:31 PM
(Setting aside the fact that you seem to be aiming to use tables for layout [tut, tut] ...) Why don't you just use CSS border property (like you're supposed to)?

e.g.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
* {
margin: 0;
padding: 0;
}

td {
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
}
</style>
</head>

<body>

<table cellpadding="0" cellspacing="0" border="0" style="width: 377px;">
<tr>
<td>Test</td>
</tr>
</table>

</body>
</html>


p.s. Please don't aim for quirks mode. You'll make the baby Jesus cry.

kag
03-20-2006, 06:41 PM
Yes I'm using table layouts for this project. I know that's not how it's done in 2006, but that's not the point. Thanks for the pointer :) , but I would still like to understand why my example doesn't work as expected.

mark87
03-20-2006, 06:53 PM
Try playing with the line-height and font-size on those cells.

kag
03-20-2006, 07:01 PM
Thanks mark87, setting both of these properties to 0 made it work beautifully. I still don't get why I should have to set those to zero since I don't have any text in my cell. Ahh the joys of HTML sometimes...

drhowarddrfine
03-20-2006, 07:12 PM
Didn't follow this thoroughly but IE won't let you set anything less than the line-height so that's why you need to set it to zero.