Loading Please Wait...
XHTML is HTML with XML support. XML is more Extensible Markup Language in which syntax must be strictly followed.
XHTML is EXtensible HyperText Markup Language. Having all the features of HTML and XML makes XHTML more extensible and flexible.
IN XHTML all the elements must be properly formatted. In HTML we have learn that browser try to display web page even if there are markup errors such as no ending tag, no doctype, etc. But this must be corrected in XHTML so that browser display the correct information.
<!DOCTYPE> must be include.
xmlns attribute must be added in <html> tag.
<html>, <head>, <title>, and <body> elements must be defined.
Each and every element must be properly nested.
All elements must be closed even if it is empty tag like <br>
Element and attribute names must be in lowercase.
Attribute must be properly quoted.
Attribute must be fully described.
<!DOCTYPE>, <html>, <head>, <title>, and <body> elements must be defined.
html and xmlns attribute must be added.
See below example for syntax with minimal requirement.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Title of document</title>
</head>
<body>
Body main content goes here...
</body>
</html>
All Elements must be properly nested accordingly one after another.
<!-- Correct Nesting -->
<p><strong>Pragraph text</strong></p>
<!-- Incorrect Nesting -->
<p><strong>Pragraph text</p></strong>
All Elements must have an ending tag. Even for empty element they must be closed too. Use / to close empty element at the end before greater than.
<!-- Correct -->
<p>Pragraph text</p>
<!-- Incorrect -->
<p>Pragraph text
<!-- For empty element use / at the end -->
<br />
<hr />
<img src="" alt="" />
All Element and attribute name must be they must be defined in lowercase only.
<!-- Correct -->
<p style="color: red;">Pragraph text</p>
<!-- Incorrect -->
<P Style="color: red;">Pragraph text</P>
Attribute values must be properly quoted.
<!-- Correct -->
<img src="logo.png">
<!-- Incorrect -->
<img src=logo.png>
Attributes are fully described, no minimization allowed.
<!-- Correct -->
<input type="text" disabled="disabled">
<input type="checkbox" checked="checked">
<!-- Incorrect -->
<input type="text" disabled>
<input type="checkbox" checked>
How you feel about this blog:
Share this blog on:
If you find any error in the turtorials, or want to share your suggestion/feedback, feel free to send us email at: info@lynxsia.com
Contact UsWe are concern with various development process like website design & development, E-commerce development, Software development, Application development, SMS & Bulk SMS Provider, PWA Development, and many more..
Copyright ©
, Lynxsia IT Solutions, All rights reserved