Page 1 of 1

IE fix

Posted: Sun Jun 26, 2011 12:40 pm
by Isaac
So this is really good if you want your stuff to look right in IE. I'm not sure exactly what this even is, but it makes a huge difference.

Code: Select all

<!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" xml:lang="en">
It must go at the very top, above <html>.

Re: IE fix

Posted: Sun Jun 26, 2011 2:10 pm
by Sirius
It's an XML document type definition... basically declares that it's an XML document and a few other things. Technically it's required for valid XHTML.

Re: IE fix

Posted: Sun Jun 26, 2011 2:18 pm
by Isaac
Ha! That's good to know, though I'm still not sure why it helps css so much.

Re: IE fix

Posted: Sun Jun 26, 2011 2:25 pm
by Krom
Because it kicks newer versions of IE into a higher compliance mode. I not entirely sure, but its unlikely that will work for most versions (might be a newer feature as of version 9).

Re: IE fix

Posted: Sun Jun 26, 2011 3:21 pm
by Jeff250
Remember in the other thread when I suggested you start declaring a doctype so that, among other things, IE would be less horrible at rendering things? ;) It works at least as far back as IE 6 to get it out of "quirks" mode. For IE, it just requires any doctype.

You probably don't want XHTML 1.1 though, since it requires delivering your documents with an XML mime type, which IE6 prompts people to download as a file (gah) instead of view. XHTML 1.0 doesn't require this--you can use an HTML mime type. Consider HTML 5 as well, which also supports (but does not require) XML syntax. Regardless, make sure you make this happy:
http://validator.w3.org/

Re: IE fix

Posted: Sun Jun 26, 2011 3:26 pm
by Isaac
Jeff250 wrote:Remember in the other thread when I suggested you start declaring a doctype so that, among other things, IE would be less horrible at rendering things? ;)
Yes I do! And I should have taken care of this a long time ago when you told me!

Jeff250 wrote: It works at least as far back as IE 6 to get it out of "quirks" mode. For IE, it just requires any doctype.

You probably don't want XHTML 1.1 though, since it requires delivering your documents with an XML mime type, which IE6 prompts people to download as a file (gah) instead of view. XHTML 1.0 doesn't require this--you can use an HTML mime type. Consider HTML 5 as well, which also supports (but does not require) XML syntax. Regardless, make sure you make this happy:
http://validator.w3.org/
omg... 46 errors...

Re: IE fix

Posted: Sun Jun 26, 2011 3:33 pm
by Jeff250
It's probably not really that bad. Start with the one on the top, since that one could be cascading "errors" all the way down. You may also need to go doctype shopping for something more lenient.

Re: IE fix

Posted: Sun Jun 26, 2011 3:39 pm
by Isaac
Like this one, right?

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

Re: IE fix

Posted: Sun Jun 26, 2011 3:54 pm
by Jeff250
Perhaps, or HTML 5. The problem with Transitional is that you can still get less strict rendering depending on the browser (still not as bad as declaring nothing).

Re: IE fix

Posted: Sun Jun 26, 2011 6:17 pm
by Isaac
Hmm.. the html5 doc type looks really simple:
<!DOCTYPE HTML>

Re: IE fix

Posted: Sun Jun 26, 2011 7:39 pm
by fliptw
as it should, as the standard technically isn't finished.

Do HTML 4 strict.

Re: IE fix

Posted: Sun Jun 26, 2011 10:40 pm
by Jeff250
The simplicity of the HTML 5 doctype has nothing to do with the standard not technically being finished. That's the doctype. It's simple by design.

Re: IE fix

Posted: Mon Jun 27, 2011 8:28 am
by Isaac
Ok, I tested the <!DOCTYPE HTML> doctype tag on IE6, IE7, and IE8. It works on all of them! By that I mean, all my css controlled layouts are consistent! Yeah, this by far the best alternative, simply because I have it memorized, unlike the other doctypes. Thanks Jeff!

Re: IE fix

Posted: Mon Jun 27, 2011 1:02 pm
by Isaac
fliptw wrote:Do HTML 4 strict.
I'll try that for sure! I've seen it, but I haven't used it.





=======================================

Question to all:

Is ajax generally not used by IE8 systems, by default? Is it also something that Internet security systems block? I was at a lab today and my comment box wouldn't work. I'll have to spend time on this later to understand why this happened for my setup, but I thought it wouldn't hurt to ask. I did a search and found that there is some incompatibility in some cases, but I always assumed that ajax is something all desktop browsers used, even IE.

Re: IE fix

Posted: Mon Jun 27, 2011 5:37 pm
by Jeff250
In general, it should work. The issue sounds specific to your lab machine or your code.

Re: IE fix

Posted: Mon Jun 27, 2011 5:39 pm
by Isaac
I'd bet it's my code... I hope its my code; that I can fix.

Re: IE fix

Posted: Mon Jun 27, 2011 10:59 pm
by fliptw
I wouldn't be surprised they got that locked down at your lab.

Re: IE fix

Posted: Thu Aug 04, 2011 8:08 am
by Thenior
fliptw wrote:I wouldn't be surprised they got that locked down at your lab.
By "it", they probably just have javascript blocked - since ajax is just javascript making page requests.