Forum Moderators: not2easy

Message Too Old, No Replies

Netscape 7.1 Strict Image Display Issue

CSS / Doctype Query

         

jshallard

8:10 am on Jun 23, 2004 (gmt 0)

10+ Year Member



Does anyone have any idea where the following extra space comes from and how to get rid of it?

When I use either XHTML 1.0 - Strict or HTML 4.01 document type definition, the following code puts a space between every image and the edge of the div ONLY in Netscape 7.1 (that I have seem - also tested on Netscape 6 and IE 5 & 6):


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<style>
Div
{
margin:0px;
padding:0px;
background-color:#ffff90;
border: 0px;
}
</style>
</head>
<body>
<div><img src="visible_spacer.gif" width="5" height="50" /></div>
<div><img src="visible_spacer.gif" width="5" height="26" /></div>
<div><img src="visible_spacer.gif" width="5" height="174" /></div>
</body>
</html>

*NB a single pixel gif of any visible color called "visible_spacer.gif" is required for the above example

I have tried all the css styles I can think of to get the space to go away. If I remove the DOCTYPE the problem goes away, but I ideally need to use a strict doctype to confirm to accessibility standards.

Any help much appreciated.

Span

8:27 am on Jun 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



div img {
display:block;
}

..will solve the problem.
Here is why: [devedge.netscape.com ]

jshallard

9:45 am on Jun 23, 2004 (gmt 0)

10+ Year Member



Thank you very much. I wish I had seen that article sooner!