The main differences between HTML and XHTML are as follows:
1)
All tags are written in lowercase in XHTML
whereas in HTML tags can either be written in uppercase or in lowercase.
2)
Nested tags must be well formed in XHTML whereas
in HTML tags can be randomily kept (but it brings various changes in the
webpage).
3)
All tag attributes must be quoted in XHML
whereas in HTML we can quote or unquote .
4)
All tags must be closed on XHTML (EX ;
<hr/><br/>) whereas there is no compulsory in HTML.
Defining XHTML: XHTML stands for Extensible hypertext markup
language.
·
XHTML is sticker and clearer version of HTML
4.01
·
XHTML is almost identical to HTML 4.01
·
XHTML is HTML defined as an XML applications.
·
XTML is supported by all major browsers.
XHTML structure: An XHTML document begins with declaration that
declares the version of XHTML to which the document conforms . The HTML element
allows and contains the head and body. The head contains information about the documents such as its
title and keywords, while body contains the actual content of the document.
Example:
<!DOCTYPE html>
<html>
<head>
<title>
My XML title</title>
</head>
<body>
<h1>Saroj Dahal
</h1>
<br/>
</body>
</html>
No comments:
Post a Comment