Forum Moderators: open

Message Too Old, No Replies

XHTML form CSS works in IE, not in NS6 ..?

NN 6 won't obey display:inline for the form

         

thesophomore

10:31 pm on Jun 6, 2003 (gmt 0)

10+ Year Member



Hey all,

I searched this forum for a solutiuon to my problem but didn't find one. If anyone can help, much thanks in advance...

I'm building a new site and want to make it xhtml compliant. I have the following 3 lines at the top of every page:

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

So far so good, right? I also have the following css definition on all pages:

form {display: inline;}

Of course this is to prevent the line break after the </form>. It works great on IE, both Mac and Win, but NS6 is still displaying the form as block, not inline.

I've found that if I change the DTD line to this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

...NS6 will display the form inline like I want it to. Is this a problem with the way NS6 interprets the XHTML DTD? It seems like if I use the XHTML DTD (both 1.0 and 1.1, strict and transitional), no matter what I do, the form always displays block style. I have not been able to find a way to keep the XHTML DTD and at the same time make NS6 forms display inline. Is it hopeless? What am I missing?
Thanks in advance!

P.S. -- I'm not interested in the </td></form></tr> hack because it's not well-formed or valid markup, and I don't care what the form looks like in NS4.

pageoneresults

10:41 pm on Jun 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hello thesophomore and Welcome to WebmasterWorld. You could also do this instead...

form{margin:0;}

I haven't been doing much testing in NN6 but one or the other should work with all. Or possibly a combination of both?

thesophomore

11:32 pm on Jun 6, 2003 (gmt 0)

10+ Year Member



form {
display: inline;
margin: 0;
}

Worked a charm, thanks a million! Wonder why I couldn't find this documented anywhere else...

hartlandcat

11:31 am on Jun 8, 2003 (gmt 0)

10+ Year Member



"NS6" is used by very few. I assume you mean NS6+ (i.e NS6/NS7).

thesophomore

3:30 pm on Jun 8, 2003 (gmt 0)

10+ Year Member



Actually, if you want to get technical, it's NS5. Going by the appVersion property of the browsers' object models, I was experiencing this problem in "5.0 (Windows; en-US)" and "5.0 (Macintosh; en-US)". The actual Gecko builds / releases (according to the userAgent property of the object models) were 20020823/7.0 on Windows, and 20020508/6.2.3 on Macintosh. I was experiencing the same problem with both, so I assumed the problem originated in release number 6 and extended to release 7. I'm sure it's just a disagreement between the developers at Microsoft and AOL Time Warner about how the XHTML specification should be interpreted and applied practically in browsers.

But yes, in the future, I shall refer to this as NS6+ to make it easier for all to understand. Thanks for pointing out my faulty browser shorthand naming convention. Or, maybe I'm still wrong? Some others may possibly believe I should instead refer to the browser release series as NN6+? I apologize, for the most part I know what I'm doing and don't post in forums because I can usually find answers to questions like this on my own. Apparently I'm still uneducated enough to not know what the universally accepted abbreviation for Netscape version releases #6 and beyond is. I promise I will try to be more careful in the future, if I ever post in this forum again. Please accept my apologies.

tedster

5:18 pm on Jun 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Wonder why I couldn't find this documented anywhere else...

Well, thanks for helping us document it here. I appreciate you stepping out and asking the question and reporting back about what worked.

I think that a lot of our members here stay pretty well "ahead of the curve", and your contribution will be put to good use.

<added>
Did you experiment with the "full" HTML 4.01 DTD - including the URL?
</added>

thesophomore

6:22 pm on Jun 8, 2003 (gmt 0)

10+ Year Member



<quote>
Did you experiment with the "full" HTML 4.01 DTD - including the URL?
</quote>

No, but I didn't really need to. I wanted my DTD to be XHTML, not HTML. Since I noticed that my problem was resolved by using the HTML DTD, that lead me to believe that the undesirable effect was caused by the NN6+ interpretation of the XHTML DTD.

I'm pretty sure that the NN6+ interpretation was more correct than IE's according to the W3C specification since, from all I've read, NN6+ is supposed to be the most strictly standards-compliant browser. Plus, from my experience, IE developers seem to build in more error checking to compensate for html coding mistakes when it comes to GUI display. For example, (and this is documented well in this forum as well as others) not adding the following css definition will also cause undesirable GUI effects in NN6+ using the XHTML DTD:

td img {
display: block;
}

Even though IE doesn't require this style to "correctly" (correctly only in my opinion) display images in table cells when using the XHTML DTD, NN6+ does. Since most people use IE anyhow, I'm sure a lot of these differences go unnoticed by the majority.