Forum Moderators: open
If you are using HTML - or XHTML also - you can use a standard HTML comment placed before the doctype:
<!-- this triggers quirks in IE6 only -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> I personally would favor this approach over using an XML declaration which has little relevance in the context of a document served as
text/html, however the ideal solution would be to fix the underlying problem which is causing you to favor quirks mde in IE. [edited by: encyclo at 2:02 am (utc) on Oct. 4, 2005]
the ideal solution would be to fix the underlying problem which is causing you to favor quirks mde in IE.
I agree. Not only do you get much more dependable results cross-browser, but you also know your website is more future-compatible than if you depend on quirks mode. I would say its even better to include hacks in your CSS than to deliberately trigger quirks mode - the hacks can easily be removed from a single file at a later date, whereas the HTML comment would have to be removed from every page.
Does anyone know if the comments trick works in IE7? I haven't heard anything about that yet and can't get IE7 running on my W2K box.
I don't have IE7, and don't know if it's available for public download or still in beta testing, so I can't say what will happen there.
The css I'm using is (ie only):
body {
margin: 0;
padding: 0;
background: #dbcbdf url(vine-bg01.gif) repeat-y fixed 100% 0%;
overflow: hidden;
}
div#body {
height: 100%; overflow: auto;
}
div.ivy-top {
position: absolute; top: 0px; left: auto; right: 80px;
padding: 0; margin: 0;
width: 705px;
}
The html I'm using looks as follows:
<body>
<div class="ivy-top"><img src="ivy-top.gif" width="705" height="92" alt="" /></div>
<div id="body">...
Cutting out some unnecessary to get to the point. But with the above, any absolute positioned div that falls outside of the #body div acts as a fixed position.