[FX.php List] Tired of making special solutions for every browser?

Leo R. Lundgren leo at finalresort.org
Thu May 7 16:01:53 MDT 2009


7 maj 2009 kl. 17.04 skrev Tim 'Webko' Booth:

>>>>
>>>> ---
>>>> On the top of each of your solutions, you will have less  
>>>> problems. Why?
>>>> Because this is the DOCTYPE that most browsers renders in almost  
>>>> the same way.
>>>
>>> I'd like for that to be true, but IE6 (still 20%+ of my users)  
>>> will fail this rather badly - it didn't (and never will) have  
>>> proper XHTML 1.0 compliance. If only IE had actually followed the  
>>> standards in the first place!!
>>>
>>> Use of IE 6 specific style sheet hacks will get around the worst  
>>> of it, but sometimes I still have to resort to table based layouts  
>>> for very-very-backwards compatability. Which sucks.
>>
>> IE always did and always will suck, I agree. Not even in version 7,  
>> which isn't THAT old, did Microsoft bother to follow some of the  
>> most basic parts of web standards. If it was up to me, everyone  
>> would stop using IE below version 8.
>>
>> However, one important thing to note regarding the common  
>> misconception that writing your site in XHTML is the way to go, is  
>> that the absolute majority of developers don't know how to do it,  
>> resulting in that their site isn't interpreted as XHTML at all  
>> (they just think everything is fine because all they look at is the  
>> validator and output XHTML from their server).
>>
>> Unless you really feel confident that you know why I'm saying this  
>> about XHTML, you are probably serving your XHTML pages as plain  
>> HTML and/or your pages are just tag soup to the browser and/or it  
>> interprets it in quirks/tolerant mode.
>
> OK, now I'm intrigued - if I have declared my outputted page as  
> XHTML in the head, and it then validates vs a decent validator, and  
> it is valid XML - how is it not XHTML??
>
> (Oh and don't get me wrong, for various reasons some of the sites I  
> am 'responsible' for are very badly broken on that level, but I know  
> how and why)


I think it's better if you read the link I pasted than me trying to  
give a good summary of the problems :-)

What Gareth elaborated was quite to the point though:

> I believe what they're alluding to is that XHTML pages should be  
> served as
> application/xhtml+xml, not text/html as most webservers do. However  
> this
> usually requires some form of content negotiation as not all clients  
> will
> understand application/xhtml+xml correctly.

Part of the problem is that 1) incorrectly served XHTML isn't parsed  
like XHTML at all and thereby loses its entire purpose, and 2)  
correctly served XHTML isn't handled at all or correctly by many  
browsers; For example IE6 doesn't even support XHTML at all -- it just  
parses the code in a very tolerant way (like it does with everything  
else since it doesn't follow standards ;-) which makes it work anyway  
(since XHTML and HTML are so similar in their syntax).

Personally I most often use and recommend using HTML 4.01 Strict (or  
Transitional in some cases where you'd need to), or maybe HTML5 (which  
I don't know all that much about regarding browser support and so on,  
so I can't really speak for that). This seems to be the choice of  
pretty much all web developers I speak to and consider very  
knowledgable as well.

I'd like to point out one thing though; It is of course perfectly fine  
to use XML and XHTML in situations where you 1) serve it correctly and  
2) have clients that can actually handle it and thereby make use of  
its features. It's just that the web is currently not the right place  
for it, at least not for perfectionists or developers who want to  
encourage the use of standards.

-|



More information about the FX.php_List mailing list