HTML vs Xhtml; which one to start with
Instead of reinventing the wheel, here's a great post explaining the difference between the two. But to quote w3schools and give you a basic summary:
The Most Important Differences:
XHTML elements must be properly nested
XHTML elements must always be closed
XHTML elements must be in lowercase
XHTML documents must have one root element
They're so similar that it really doesn't matter which one you learn first as the differences are minor for what you want to do. I'd say start with HTML as it is technically simpler and branch out to xHTML once you think you're ready.
Adding to the recent responses, it is beneficial to know the differences between HTML4.01 & XHTML 1.0 and the previous responses sum those differences up. Already stated too that you should start learning about the new elements introduced into HTML5 and the minor changes in semantics. The great thing about the HTML5 spec is that it was built, in the loosest sense, backwards compatible with your HTML4.01 or XHTML code. Meaning that your (X)HTML page can instantly become an HTML5 page with simple substitution of the old doctype with the new <!doctype html>
. An excellent resource for an HTML5 summary - Dive into HTML5
If you do decide to go the HTML5 route which I'd recommend, there are drawbacks as older Internet Explorers like versions 6-8 that will not recognize new HTML5 elements like article
or aside
. However there are a few javascript libraries that allow those dated browsers to recognize the new elements so that you may be able to style them. Check out Modernizr or html5shiv
Important differences (referenced from W3schools, I know, I know)
- XHTML elements must be properly nested
- XHTML elements must always be closed
- XHTML elements must be in lowercase
- XHTML documents must have one root element
So it's not a different language, it's a different set of standards.
I recommend you start learning HTML5, it's the future, and it's pretty mature at the moment. There really isn't much difference between them all when learning the basics and getting going, but you should probably just pick the most up to date one.