Difference Between HTML and XHTML
HTML vs XHTML
Comparing HTML(Hypertext Markup Language) and XHTML(Extensible HTML) could be like comparing identical twins since there are only a few minor points which we can actually point out as being different. This is due to the fact that XHTML was derived from HTML just to conform with XML standards. The primary major difference between the two is the relative strictness of XHTML compared to HTML. While someone coding in HTML could get away with some lapses in structure and coding, that is no longer possible with XHTML. The need to come up with XHTML emerged from the fact that HTML has become to convoluted with browser specific tags that pages coded in html doesn’t always look the same in all browsers.
All XHTML documents must have only one root element and all elements must be written in lowercase, closed, and properly nested. And although you can actually do the same with HTML, it is actually not required and you can violate any or all of those rules and your HTML document can still be opened without any errors. Another XHTML only requirement is the declaration of the DOCTYPE that determines what rules your document would follow; which it inherited from XML. Not only is the strictness of XHTML prominent in the structure, even variables have been limited to lower case letters and the values assigned to them must be surrounded by quotation marks for it to be properly recognized.
Although in an as-is basis, XHTML provides little to no improvement over HTML, the edge of XHTML shows when using it in conjunction with XML tools. The strictness and overall streamlining of the HTML standards into XHTML was intended to gain the clean and and cluterfree coding that is needed to further enhance webpage creation. XHTML also allowed website builders to create modularized code that they can use repeatedly in multiple projects.
Part of HTML’s success was the fact that it was a very forgiving language to code in. Whatever you put into the file, the browser tries to make sense of it and puts up its best interpretation of the html file. But as browser technologies improve and webpage designs become more complex, the simplistic approach of HTML begins lose ground to XHTML’s structured approach that doesn’t leave any guessing to the browser. Though it is hard to notice for those who only browse the sites, there is already a gradual shift among webpage builders from HTML to XHTML. Indicating that HTML would soon be yeilding its position to XHTML in the near future.
- Difference Between Sony Cybershot S Series and W Series - December 22, 2012
- Difference Between Samsung Galaxy S3 and iPhone 5 - December 21, 2012
- Difference Between Samsung Galaxy S2 (Galaxy S II) and Galaxy S 4G - December 20, 2012
Search DifferenceBetween.net :
Email This Post : If you like this article or our site. Please spread the word. Share it with your friends/family.
13 Comments
Trackbacks
- Difference Between AJAX and DHTML | Difference Between
- Difference Between RSS and ATOM | Difference Between | RSS vs ATOM
- Difference Between SGML and XML | Difference Between | SGML vs XML
The points are good. It will help.
thanks again
thanks again it helps a lot
hi,
it is very good…. it wiil be usefull everyone .. thanx a lot
Your notes on HTML has helped me alot as a student who is learning computer science.It ha come helpful since our lecturer is now teaching us how to develop website.So thank Guys for your support.Am from Tanzania country.
THANKS.
thanks guyss!!!! i just finish my research about html vs xhtml..this site helped me thanks again… 😀
I’m James from Philippines.. :))
hi,
I got everything from this site. It is really helpful
it is very good…. it wiil be usefull everyone .. thanx a lot
I tend to agree with most of what you said with the exception of the last part about XHTML slowly becoming more prominent than HTML…
HTML 5 is currently being worked on, and while it is a ways off from becoming a specification – many new browsers have already started implementing some of it’s more notable additions. If XHTML were on the rise, the W3C wouldn’t have discontinued the development of the XHTML 2 specification.
Also, a vast majority of XHTML web pages are served as text/html documents instead of as application/xhtml+xml. What does this even mean? Well, it means the browser is interpreting all that pretty, strict, and validated XHTML as nothing more than plain old HTML (which some people would refer to as “tag soup”).
To summarize, unless you’re building a web application that requires the usage of XHTML, and by that I mean serving it with the application/xhtml+xml MIME type, then writing strict and valid HTML is probably the most logical way to go.
Beside the obvious differences in both formats, i believe its just a matter of what you prefer.