HTML - XHTML
HTML - XHTML
XHTML is HTML written in XML format.
What is XHTML?
XHTML refers to Extensible Hypertext Markup Language
XHTML is almost the same as HTML 4.01
XHTML is more strict A purer version of HTML
XHTML is HTML defined in the form of XML applications
XHTML is a W3C recommendation standard released in January 2001
XHTML is available in all major browsers Support
Why use XHTML?
Many pages on the Internet contain "bad" HTML.
If viewed in a browser, the following HTML code runs perfectly fine (even though it does not follow HTML rules):
Irregular HTML
This is a paragraph
XML is a markup language that must be correctly marked up and well-formed.
If you want to learn XML, read our XML tutorial.
There are a number of different browser technologies in today’s tech world. Some of them run on computers, while others may run on mobile phones or other small devices. Small devices often lack the resources and capabilities to interpret "bad" markup languages.
So - XHTML was developed by combining the best of XML and HTML. XHTML is HTML redesigned as XML.
The most important difference compared to HTML:
Document structure
XHTML DOCTYPE is mandatory
XML namespace attribute in are mandatory
,
,Element syntax
XHTML elements are required Correct nesting
XHTML elements must always be closed
XHTML elements must be lowercase
XHTML documents must have a root element
Attribute syntax
XHTML attributes must be in lower case
XHTML attribute values must be surrounded by quotes
XHTML attribute minimization is also prohibited
is mandatory Sexual
XHTML documents must carry an XHTML document type declaration (XHTML DOCTYPE declaration).
You can find the complete XHTML document type in the Tag Reference Manual of the Rookie Tutorial. The
,
,XHTML elements must be nested reasonably
In HTML, some elements do not need to be nested within each other, like this:
Bold and italic text
In XHTML, all elements must be properly nested within each other, like this:
Bold and italic text
XHTML elements must have a closing tag
Incorrect example:
This is a paragraph
This is another paragraph
Correct example:
This is A paragraph
This is another paragraph
Empty elements must contain closing tags
Error example:
Branch:
Horizontal line:
Image:
Correct example:
Branch:
Horizontal line:
Image:
XHTML element required is lowercase
Incorrect example:
This is a paragraph
Correct example :
This is a paragraph
Attribute names must be lowercase
Incorrect example: