Hi Guys, I came to know that Html and xhtml tags are same almost except closing tags neccessary in XHtml. so I am confused what other differences are there? Is there any extra tags in XHtml?
almost the same. yes it is a bit different that xhtml need closing tag. html xhtml <br> <br /> <img scr= ""> <img scr="" /> and so on. I have read a post today that shock me. ie doesn't support xhtml at all.
That is the only difference? Is there any extra tags or different style to write except closing tags? This is nothing almost 99.99 % the same?
Not quite. MSIE Browsers (including IE8) do not support XHTML 1.0 served as Content (MIME) Type application/xhtml+xml which is the way it should be served IAW the W3C specification. Other standards compliant Browsers -- FireFox, Opera, Safari, Mozilla, et al. do support that Content Type thus providing XML functionality. The W3C long ago added Appendix C to the XHTML 1.0 Specification that provides for serving it as Content (MIME) Type text/html -- which is really just HTML using XHTML syntax. There is one great advantage in using XHTML (even when served as text/html) versus HTML -- the well-formedness constraints make for better structured Markup for those who do not normally employ that principle when composing HTML pages. However, there is no advantage whatsoever in using valid XHTML 1.0 served as text/html versus well structured, well formed and valid HTML 4.01. Here is a page that outlines the problems serving XHTML Here is an XHTML page served as content (MIME) type application/xhtml+xml for testing by those interested. James
XHTML is a stricter version of HTML, it's basically XML and HTML mixed in. It has new rules like you can't have unclosed tags, so <br> is not legal, you need <br/> and tags must be in lower case and so on. There is no reason to use one over the other, you can use whichever you want, as long as you use the proper DOCTYPE declaring which you're using.
I understand about the closing tags in XHtml and lower case use but what is major difference other than this? Is tansitional Doctype is the best which can support all other brousers? or the strict one?
Strictness depends on what Doctype/DTD is used -- strict versions of HTML 4.01 and XHTML 1.0 do not utilize deprecated elements/attributes and render in standards mode. Only when XHTML 1.0 is served as application/xhtml+xml is it extensible-- if it is served as text/html (as it mostly is) it is nothing more than HTML using XHTML syntax. James