Question:
what is the difference between html vs xhtml?
crippldfoot
2011-05-05 08:49:15 UTC
im getting into web design, and i saw html vs xhtml, i don't know the difference.

can you state differences and similarities?

Thanks
Four answers:
?
2011-05-05 14:01:40 UTC
I tend to agree with most of what Abhi said in his answer 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.
2011-05-05 15:58:42 UTC
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.
2011-05-05 23:39:57 UTC
XHTML (eXtensible HyperText Markup Language) is a family of XML markup languages that mirror or extend versions of the widely-used Hypertext Markup Language (HTML), the language in which web pages are written.



While HTML, which stands for HyperText Markup Language, is the predominant markup language for web pages. HTML is the basic building-blocks of webpages.
2011-05-05 15:50:56 UTC
xhtml is a family of XML markup languages that mirror or extend versions of the widely-used Hypertext Markup Language (HTML), the language in which web pages are written.

While HTML (prior to HTML5) was defined as an application of Standard Generalized Markup Language (SGML), a very flexible markup language framework, XHTML is an application of XML, a more restrictive subset of SGML.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...