Login
Your Email
Pasword
Home
Write
Trending
History
Liked
Earning

What is XHTML and why we use it?

XHTML is HTML written as XML.

Do you have similar website/ Product?
Show in this page just for only $2 (for a month)
Create an Ad
0/60
0/180

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 .
<html>
<head>
<title> Bad HTML</title>
<body>
<h1>Bad HTML
<p>This is a paragraph
</body>


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
Document Structure:
XHTML DOCTYPE is mandatory.
The xmlns attribute in is mandatory.
<html><head><body> are mandatory.
XHTML Elements
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 Attributes
Attribute names must be in lower case 
Attribute values must be quoted 
Attribute minimization is forbidden

CONTINUE READING
XHTML
HTML
Ayesha
Tech writer at newsandstory