Forum Moderators: open

Message Too Old, No Replies

!DOCTYPE and pure css menus

         

silverbytes

8:15 pm on Feb 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have some pages using
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

Added a pure css menu this kind


<div id="navcontainer">
<ul id="navlist">
<li><a href="/index.htm">bla</a></li>
<li id="active"><a href="/bla.htm" id="current">Argentina </a>
<ul id="subnavlist">

That way looks good but dropdown doesn't work.
If I instead use this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

The css menu works but text in other layers looks bad (like overflowing in layer, you just see the top part of text)

Code of text not showing good


<div id="bla2" style="position:absolute; left:18px; top:33px; width:262px; height:23px; z-index:1">
<h1>title</h1>

Can't I use <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> with ure css menus?

I have a live example but posting urls is not allowed, so please ask me or sticky me.

SuzyUK

8:35 pm on Feb 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



no Pure CSS menus won't work with your first Doctype.

That first Doctype is putting IE into quirks rendering mode. In order to use the :hover (scripted or otherwise) capability your pages have to be in Compliant/Strict Rendering Mode.

The other differences you are seeing when you switch to Strict rendering mode (your second Doctype is doing that) are likely due to box model differences, IE in Quirks uses IE's old box model, you may even have some workarounds in your CSS for them already? The only browser which really needs workarounds for widths is IE5.x and moving any workarounds into a conditional comment is a suggested method of keeping it seperate and phasing them out and is in keeping with the "only hack for back compatibility" theory

IMHO you should really try and get pages out of Quirks rendering mode these days if you can, I think eventually the only "quirky" pages we will see on the web will be those built by folks that only code for IE, don't know about Doctypes, are demonstrating an IE Quirk or who use an old editor?

silverbytes

11:03 pm on Feb 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks. The problem is that using the second doctype I have the problem described here:

[webmasterworld.com...]

Any idea of what to change in order to get out of quirks?

[edited by: tedster at 11:34 pm (utc) on Feb. 19, 2007]
[edit reason] fix link [/edit]