Forum Moderators: open

Message Too Old, No Replies

Which browsers support XHTML

and which do not

         

StepOne

9:26 am on Jul 5, 2002 (gmt 0)

10+ Year Member



We are all being encouraged to write XHTML compliant web pages, but by doing so who are we excluding? Old browsers? Which ones?

Does anyone know of a list which might tell me which browsers support XHTML and which do not.

Standards are all very well, but I want as many people as possible to see my web pages as I intended, without error messages.

Puzzled newbie.

DrOliver

10:51 am on Jul 5, 2002 (gmt 0)

10+ Year Member



All browsers support XHTML, even if they don't know :)

Just make sure you close the empty tags such as <img>, <br> and others this way:

<br />

This is close to perfect, valid, no-harming xhtml.

Note the space before the "/". If you would write:

<br/>

this would be totally perfect, absolutly valid, but harming xhtml, since old browser could get a serious hickup from it.

Write in the extra space before the closing in empty tags and you're on the safe side.

There are no tags older browser would not understand, if they understand the same tags in html. So for any perfect HTML 4 browser, XHTML is no problem at all.
So if <iframe></iframe> in Netscape 4 doesn't work in HTML, so it won't work in XHTML, since the syntax of the tag is the same. Just as in HTML, the tag will be "overlooked" and only the content between opening and closing tags are being read.

StepOne

11:17 am on Jul 5, 2002 (gmt 0)

10+ Year Member



DrOliver, many thanks for taking the time to reply to my newbie question!

Can I assume that if I have already have web pages which are HTML 4.01 compliant I might as well go 'the whole hog' and put them through something like HTML Tidy and convert to XHTML 1.0.

Nick_W

1:07 pm on Jul 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It wouldn't take 5mins to do it by hand. The standards are not all that different..

Nick

papabaer

1:51 pm on Jul 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It is only when saving your documents using the .xhtml extention rather than .htm or .html that problems can occur with IE6(and lower) and NN4.x (as well as other older browsers). The issue is with the mime, or media types, and what browsers expect according to the file extention provided.

The 'text/html [w3.org]' media type [RFC2854] is primarily for HTML, not for XHTML. In general, this media type is NOT suitable for XHTML. However, as [RFC2854] says, "[XHTML1] defines a profile of use of XHTML which is compatible with HTML 4.01 and which may also be labeled as text/html".

Using any of the current flavors of XHTML doctypes and saving the document with the compatible .htm/.html file extention will tell the user-agent to render the document as text/html - your code will render as any other HTML document, even in older browsers.

However saving your XHTML authored document using the .xhtml file extention will communicate to the user-agent that the document should be interpreted as the media type 'application/xhtml+xml [w3.org]' In this instance current versions of Interent Explorer and the v.4 family of Navigator will experience problems as they try to process an unknown media type.

Please note the following quote from the W3C XHTML Media Types specifications:

'application/xhtml+xml' SHOULD be used for serving XHTML documents to XHTML user agents. Authors who wish to support both XHTML and HTML user agents MAY utilize content negotiation by serving HTML documents as 'text/html' and XHTML documents as 'application/xhtml+xml'. Also note that it is not necessary for XHTML documents served as 'application/xhtml+xml' to follow the HTML Compatibility Guidelines.

Keep in mind that a document that utilizes an XHTML doctype and is presented to the user-agent with an .htm/html file extention is still an HTML document. The difference is that is has been formatted as an XML.

XHTML [w3.org] is a family of current and future document types and modules that reproduce, subset, and extend HTML 4 [HTML]. XHTML family document types are XML based, and ultimately are designed to work in conjunction with XML- based user agents.

The XHTML family [w3.org] is the next step in the evolution of the Internet. By migrating to XHTML today, content developers can enter the XML world with all of its attendant benefits, while still remaining confident in their content's backward and future compatibility.

XHTML is a transition, a migration and evolution of HTML. Don't fear it... learn it!

StepOne

10:11 pm on Jul 5, 2002 (gmt 0)

10+ Year Member



Many thanks papabaer, this is just the sort of information I was looking for.

I am learning XHTML and will try to format future web pages to this standard using a XHTML doctype. But will save my pages with a .html extension to avoid problems with current browsers as you suggest.