Professional Documents
Culture Documents
http://www.w3schools.com/xhtml/
Dec 7, 2021
What is XHTML?
XHTML stands for Extensible Hypertext Markup
Language
XHTML is aimed to replace HTML
XHTML is almost identical to HTML 4.01
XHTML is a stricter and cleaner version of HTML
XML (Extensible Markup Language) is a markup
language designed for describing data
XHTML is HTML redefined as an XML application
XHTML is a “bridge” between HTML and XML
2
The problem with HTML
HTML started out as a way of way of describing the
structure of documents, with tags to indicate headers,
paragraphs, and the like
Because people wanted to control the appearance of
documents, HTML acquired tags to control fonts,
alignment, etc.
The result is a markup language that does both, but isn’t
very good at either
3
HTML vs. XML
6
Note :
A common mistake with nested lists, is to forget that the
inside list must be within <li> and </li> tags.
This is wrong:
<ul>
<li>Coffee</li>
<li>Tea
<ul>
<li>Black tea</li>
<li>Green tea</li>
</ul>
<li>Milk</li>
</ul>
This is correct:
<ul>
<li>Coffee</li>
<li>Tea
<ul>
<li>Black tea</li>
<li>Green tea</li>
</ul>
</li>
<li>Milk</li>
</ul>
XHTML Documents Must Have One Root
Element
<html>
<head> ... </head>
<body> ... </body>
</html>
SGML and DTDs
11
DOCTYPE declaration, II
The three main DTDs are as follows:
Strict
Use for really clean markup, with no display
information (no font, color, or size information)
Use with CSS (Cascading Style Sheets) if you want
to define how the document should look
Transitional
Use with standard HTML and/or with CSS
Allows deprecated HTML elements
Frameset
Use if your document uses HTML frames 12
An XHTML Example
13
Tools
Dave Raggett's HTML TIDY
http://www.w3.org/People/Raggett/tidy/
is a free UNIX tool for checking and cleaning up
HTML pages
W3C HTML Validation Tool
http://validator.w3.org/ is an HTML form for checking
(but not fixing) HTML and XHTML documents
14
Vocabulary
SGML: Standard Generalized Markup Language
HTML: Hypertext Markup Language
XHTML: eXtensible Hypertext Markup Language
XML: eXtensible Markup Language
DTD: Document Type Definition
15
The End
16