Re: XHTML Problem With Netscape 6

by "Kehvan M. Zydhek" <kehvan(at)zydhek.net>

 Date:  Tue, 26 Feb 2002 08:32:11 -0800
 To:  <gscott(at)tds.net>,
<hwg-techniques(at)mail.hwg.org>
 References:  tds
  todo: View Thread, Original
Greg,

First off, you can't validate to XHTML (at least not STRICT) with border="0"
or vspace="0" in the image tags. Neither are valid attributes. You can
probably fix this rather simple problem by adding the following to your CSS:

img {border: 0px; padding: 0px; margin: 0px;}

and, either as a part of that tag, or on just the images being messed up by
NS6:
style="vertical-align: bottom;"

I ran into this same problem, and the above is the solution. However, I had
to add the extra styling to just the affected images, as when it was applied
to ALL the images on my site, it resulted in ALL images being squished
together. IE6 and OP6 continue to render properly, so no browser detection
scripts are needed.

Additionally, since you're trying for XHTML, might as go whole-hog and stick
the width/height attributes in CSS styles, too, since that's more proper
(although it'll still validate with them as they are).

Now, the unfortunate thing is that the above code *MIGHT* mess up NS4.x. I
made the decision last year to stop writing code for NS4.x and any other
non-compliant browsers, as the site logs *FOR MY SITES* show that the vast
majority of my visitors (roughly 95%) are using compliant browsers. That may
not be true for your site, so you'll have to measure the pros and cons
appropriately.

Hope this helps!
Kehvan M. Zydhek

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: NORTON ANTI-VIRUS 2002 scanned this email prior to sending. It is free
:: of any known embedded or attached viruses, trojans, or internet worms.
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


----- Original Message -----
From: "Greg Scott" <gscott(at)tds.net>
To: <hwg-techniques(at)mail.hwg.org>
Sent: Tuesday, February 26, 2002 06:42
Subject: XHTML Problem With Netscape 6


> I'm having a problem with Netscape 6 displaying images separated with
> <br /> properly when using an XHTML doctype. (<!DOCTYPE html PUBLIC
> "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >)
>
> I want the images stacked right on top of each other with no space
> between them.  Ex:
>
> <img src="images/image1.gif" width="127" height="85" border="0"
> vspace="0" /><br />
> <img src="images/image2.gif" width="127" height="73" border="0"
> vspace="0" />
>
> In Netscape 4.7 and Internet Explorer, the images display properly with
> no space between but in Netscape 6.2 there is a space between the
> images.  If I change the doctype to HTML 4, the problem goes away.
>
> Am I doing something wrong or is there a work-around, or do I need to go
> back to the HTLM 4 doctype?
>
> Greg
>
>
>
>

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA