What is XHTML and why we use it?
XHTML is HTML written as XML.
XHTML stands for EXtensible HyperText Markup Language It is almost identical to HTML It is stricter than HTML XHTML is HTML defined as an XML application and supported by all major browsers.
Many pages on the internet contain "bad" HTML. This HTML code works fine in most browsers .
<title> Bad HTML</title>
<p>This is a paragraph
XML is a markup language where documents must be marked up correctly and was developed by combining the strengths of HTML and XML.
Differences from HTML
XHTML DOCTYPE is mandatory.
The xmlns attribute in is mandatory.
<html><head><body> are mandatory.
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
Attribute names must be in lower case
Attribute values must be quoted
Attribute minimization is forbidden
Tech writer at newsandstory
Total 168 views