|
Posted by Alan Silver on February 20, 2006, 11:13 am
Please log in for more thread options
>Alan Silver wrote:
>
>> I have read about the problems that IE has when using a doctype of HTML
>> 4.01 Transitional. I was advised to use Strict wherever possible.
>
>Presumably you're talking about doctype sniffing? IE6 can render a
>document in one of two ways: Quirks mode which emulates the flaws of
>IE5 and Standards mode which doesn't.
Erm, here's where my ignorance begins to show!! I was talking about
avoiding quirks mode, which I understand to be fairly evil.
>Quirks mode is triggered by a HTML 4.01 Transitional doctype without an
>URL (i.e. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
>Transitional//EN">) - note that it is merely the doctype that triggers
>the switch to quirks mode. Whether the actual HTML matches the doctype
>isn't a factor.
>
>Standards mode is triggered by a HTML 4.01 Transitional doctype with a
>URL (i.e. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
>Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">) and by HTML
>4.01 Strict doctypes.
Ah, I obviously got the story wrong. I thought it was Transitional that
sent IE into quirks mode and Strict that didn't. Thanks for the
clarification, that makes life much easier.
>XHTML 1.0 (Strict or Transitional) triggers Standards mode unless there
>is an XML declaration (e.g. <?xml version="1.0" encoding="UTF-8"?>)
>preceeding it in which case Quirks mode is triggered.
So, if I have a doctype like this...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
will this give me standards mode? If so, then I think I have solved my
problem.
>> My question is, does the same apply to XHTML 1.0 Transitional? I develop
>> sites using ASP.NET, which emits valid XHTML 1.0 Transitional, but not
>> XHTML 1.0 Strict
>
>It should be possible to make .net extrude whatever code you want it
>to. It's a fairly crap tool if it doesn't.
It may be possible, I don't know. I know that by default it emits XHTML
1.0 Transitional (apparently not Strict as I thought when I posted). I
don't have a problem using that, so I haven't really explored the
possibilities of changing it.
>> (for example, it includes a hidden form field with the
>> name of _VIEWSTATE, which isn't valid in Strict, but is in
>> Transitional).
>
>Eh?
<snip>
OK, I could have got that badly wrong. I know that when I first started
fixing some code, I was getting problems of this sort, but maybe I'm
getting confused now. I'll need to go back and check it again.
>> Anyone any comments? The framework is brilliant, but I'm a bit stuck
>> trying to produce 100% valid code. Am I likely to have any browser
>> problems with XHTML 1.0 Transitional?
>
>Not really. Assuming .net extrudes "Appendix C compliant XHTML
>flavoured tag soup served as text/html", then browsers will treat it as
>either Quirks Mode (X)HTML tag soup or Standards Mode (X)HTML tag soup
>just the same as they would do with HTML 4.01.
Well, as far as I know, it sends out 100% valid XHTML 1.0 Transitional,
excluding the odd bug!!
Thanks very much for the reply. I think your clarification has sorted me
out.
--
Alan Silver
(anything added below this line is nothing to do with me)
|