Forum Moderators: open

Message Too Old, No Replies

Should I be using XHTML?

XHTML - Should i use it

         

one_mind

7:11 am on Jul 4, 2006 (gmt 0)

10+ Year Member



Hi,

Just a quick question about xhtml.

I am about to start a new site and am wondering whether to use html 4 or xhtml.

Is it too soon for xhtml, i mean, will all browsers be able to read it?

Thanks for any info.

kiwibrit

7:44 am on Jul 4, 2006 (gmt 0)

10+ Year Member



Perhaps this thread [webmasterworld.com] will help you decide.

Robin_reala

9:46 am on Jul 4, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Simple answer: if you're asking the question then no. Go with HTML 4.01 strict. XHTML is useful in many ways but if you don't need the extensibility there's not much point. It also doesn't work in IE.

penders

2:15 pm on Jul 4, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If you did decide to markup your pages as XHTML, they will still most probably be served as "text/html" anyway, as if they were in standard HTML (this is HTML compatible XHTML). True XHTML documents should be served as the mime-type "application/xhtml+xml", which can only be done by the server. You cannot simply enter the correct meta tag into your (X)HTML document.

IE6 does not support the mime-type "application/xhtml+xml", so IE6 does not support true XHTML documents (as Robin states above). However, IE will display XHTML documents that are still being served as "text/html" (XHTML in HTML compatibility mode), so your pages are safe.

So, if you are really taking advantage of the X in XHTML then you need to serve it as "application/xhtml+xml" to those browsers that support it (Firefox etc.) and as "text/html" to those that don't (IE6...). All sounds a bit messy!

Most people say they are using XHTML, but what they are really doing is serving XHTML as good old fashioned HTML.

Does IE7 support this mime-type?

HTML4.01 isn't going anywhere anytime soon. If you always close all your tags, use lowercase tags (because XML is case sensitive), no empty tags etc. etc. then you should be pretty safe if you do have to switch.

one_mind

2:22 pm on Jul 4, 2006 (gmt 0)

10+ Year Member



Cool, thanks guys :)

HTML 4.1 it is then :)

Robin_reala

6:56 pm on Jul 4, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



penders: No, IE7 doesn't support true XHTML. Microsoft have acknowledged it as a 'wanted feature' but help off for IE7 as they 'want to do it properly'.