What Is XHTML?
- XHTML stands for EXtensible HyperText Markup Language
- XHTML is almost identical to HTML 4.01
- XHTML is a stricter and cleaner version of HTML
- XHTML is HTML defined as an XML application
- XHTML is a W3C Recommendation of January 2000.
- XHTML is supported by all major browsers.
Bad HTML
Bad HTML
This is a paragraph
The Most Important Differences from HTML:
- 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
XHTML Elements Must Be Properly Nested
In XHTML, all elements must be properly nested within each other, like this:This text is bold and italic
XHTML Elements Must Always Be Closed
Non-empty elements must have a closing tag.This is wrong:
This is a paragraph
This is another paragraph
This is correct:
This is a paragraph
This is another paragraph
Empty Elements Must Also Be Closed
Empty elements must also be closed.This is wrong:
A break:
A horizontal rule:
An image:
This is correct:
A break:
A horizontal rule:
An image:
XHTML Elements Must Be In Lower Case
Tag names and attributes must be in lower case.This is wrong:
This is a paragraph
This is correct:
This is a paragraph
XHTML Documents Must Have One Root Element
All XHTML elements must be nested within the root element. Child elements must be in pairs and correctly nested within their parent element.The basic document structure is:
…
…
Source: http://www.psd-to-xhtml-conversion.com/review/xhtml-tutorials/http://www.psd-to-xhtml-conversion.com/review/xhtml-tutorials/