HTML and XHTML
HTML and XHTML
Page 1 of 11
w3schools.com
HTML
CSS
TUTORIALS
Next Chapter
What Is XHTML?
XHTML
XHTML
XHTML
XHTML
XHTML
Why XHTML?
<html>
<head>
http://www.w3schools.com/html/html_xhtml.asp
02-08-2016
Page 2 of 11
XHTML Elements
XHTML
XHTML
XHTML
XHTML
XHTML Attributes
http://www.w3schools.com/html/html_xhtml.asp
02-08-2016
Page 3 of 11
In HTML, some elements can be improperly nested within each other, like this:
http://www.w3schools.com/html/html_xhtml.asp
02-08-2016
Page 4 of 11
In XHTML, all elements must be properly nested within each other, like this:
<p>This is a paragraph
<p>This is another paragraph
This is correct:
<p>This is a paragraph</p>
<p>This is another paragraph</p>
A break: <br>
A horizontal rule: <hr>
An image: <img src="happy.gif" alt="Happy face">
This is correct:
http://www.w3schools.com/html/html_xhtml.asp
02-08-2016
Page 5 of 11
<BODY>
<P>This is a paragraph</P>
</BODY>
This is correct:
<body>
<p>This is a paragraph</p>
</body>
<table WIDTH="100%">
This is correct:
<table width="100%">
http://www.w3schools.com/html/html_xhtml.asp
02-08-2016
Page 6 of 11
<table width=100%>
This is correct:
<table width="100%">
http://www.w3schools.com/html/html_xhtml.asp
02-08-2016
Page 7 of 11
Correct:
http://www.w3schools.com/html/demo_xhtml.asp
Validate the page
Previous
http://www.w3schools.com/html/html_xhtml.asp
Next Chapter
02-08-2016
Page 8 of 11
COLOR PICKER
LEARN MORE
HTML Cards
Google Maps
Animated Buttons
Modal Boxes
http://www.w3schools.com/html/html_xhtml.asp
02-08-2016
Page 9 of 11
Modal Images
Tooltips
Loaders
Filter List
JS Animations
Progress Bars
Dropdowns
Slideshow
Side Navigation
Top Navigation
HTML Includes
SHARE
CERTIFICATES
http://www.w3schools.com/html/html_xhtml.asp
02-08-2016
Page 10 of 11
REPORT ERROR
PRINT PAGE
FORUM
ABOUT
Top 10 Tutorials
HTML Tutorial
CSS Tutorial
JavaScript Tutorial
W3.CSS Tutorial
Bootstrap Tutorial
SQL Tutorial
PHP Tutorial
jQuery Tutorial
Angular Tutorial
XML Tutorial
Top 10 References
HTML Reference
CSS Reference
JavaScript Reference
W3.CSS Reference
Browser Statistics
PHP Reference
HTML Colors
HTML Character Sets
jQuery Reference
AngularJS Reference
http://www.w3schools.com/html/html_xhtml.asp
02-08-2016
Page 11 of 11
Top 10 Examples
HTML Examples
CSS Examples
JavaScript Examples
W3.CSS Examples
HTML DOM Examples
PHP Examples
ASP Examples
jQuery Examples
Angular Examples
XML Examples
Web Certificates
HTML Certificate
HTML5 Certificate
CSS Certificate
JavaScript Certificate
jQuery Certificate
PHP Certificate
Bootstrap Certificate
XML Certificate
W3Schools is optimized for learning, testing, and training. Examples might be simplified to improve
reading and basic understanding. Tutorials, references, and examples are constantly reviewed to avoid
errors, but we cannot warrant full correctness of all content. While using this site, you agree to have
read and accepted our terms of use, cookie and privacy policy. Copyright 1999-2016 by Refsnes Data. All
Rights Reserved.
Powered by W3.CSS.
http://www.w3schools.com/html/html_xhtml.asp
02-08-2016