Forum Moderators: open

Message Too Old, No Replies

XHTML 1.0 Strict - strange display problem

         

KennyJ

8:07 am on Dec 17, 2003 (gmt 0)

10+ Year Member



My page has a top menu made up of graphics, contained within a <div>. After the menu, there is another <div> containing the content.

There is no whitespace in the actual markup between the divs and both the divs, and their contents have CSS border, padding and margin properties set to none. XHTML validates as 1.0 Strict.

This works fine in IE5/6, Opera 6/7, NS6,etc but not in NS 7/Firebird which adds a space between the menu and the content.

However, if the DOCTYPE is change to Transitional it works with NS7 too.

Has anyone seen this before / know why this happens?

SuzyUK

8:40 am on Dec 17, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



KennyJ

try adding a (different) background color to the 2 x divs in question to see if the "whitespace" is actually between the divs or inside one or other of them..

that might help narrow down the element which is causing the space.. it's possibly default padding on an <hn> or <p> in the content div or the default graphic alignment in the menu div

Suzy

phoenix09

5:00 pm on Dec 22, 2003 (gmt 0)

10+ Year Member



The earlier Mozillas had this problem with table cells, especially cells containing image links that were supposed to fill the entire cell, this was an annoying problem that I could not get resolved, even using tricks like setting css lineheight: 0; and so on.

Mozilla fixed this problem, which only occured in an xhtml 1 html document, by version I think 1.3 or so, it's not in firebird anyway, but it looks like you've found another case with div. I currently have a couple of sites up that I could not declare as xhtml 1 transitional because they had stacked image based navigation, and this unwanted space totally ruined the page look and feel, which sounds like the problem you're having too.

Sometimes doing this will help

<div>
stuff stuff</div

instead of:
<div>
stuf stuff
</div>

Because some browsers insert a small space where a line break is, sometimes yes, sometimes no, although that's more a td problem I think.