A Reformulation of HTML 4 in XML 1.0
(Yes, I am a nerd)
XHTML
 What is it?
 Why use it?
 How do I use it correctly?
What is XHTML?
 Extensible HyperText Markup
Language
 Combination of HTML and XML
 The elements from HTML
 The syntax ...
Why should I care?
 Based on industry standards
 Cross browser support
 Validated and proper code
 Will run properly o...
Basic Structure
 One root element per document
 Properly nested elements
 Closed elements
 lowercase elements
 More s...
One root element
 The basic mandatory structure
<!DOCTYPE – more in a second>
<html>
<head>
<title></title>
</head>
<body...
Properly Nested
 BAD
<p>
This
<strong><em>
is</strong></em>
fun.
</p>
 HAPPY FUN TIME
<p>
This
<strong><em>
is
</em></st...
Closed Elements
 BAD
<p>Paragraph 1
<p>Paragraph 2
<br>
<hr>
<img src=“pic.jpg”>
 HAPPY FUN TIME
<p>Paragraph 1</p>
<p>P...
lowercase elements
 BAD
<P> another
paragraph
with an image
<Img Src=“pic.jpg” />
</p>
 HAPPY FUN TIME
<p> another
parag...
 HAPPY FUN TIME
<table width=“100%”>
</table>
<input checked=“checked” />
<option selected=“selected”>
</option>
 BAD
<t...
DOCTYPE
 Only really have to worry about this if
you create the page from scratch
 Don’t really worry about what
everyth...
Now What?
 XHTML Cheat Sheet v1.03 -
http://floele.flyspray.org/htmlcheatsheet.pdf
 Official HTML 4 page –
http://www.w3...
Who am I?
 C. Todd Barber
 Webmaster
 University of Tennessee Health Science Center
 Memphis, TN 38163
 http://www.ut...
Upcoming SlideShare
Loading in …5
×

XHTML basics

518
-1

Published on

a very basic look at XHTML. Covers the basics of the structure not how to make a web page.

Published in: Technology, News & Politics
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
518
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
22
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

XHTML basics

  1. 1. A Reformulation of HTML 4 in XML 1.0 (Yes, I am a nerd)
  2. 2. XHTML  What is it?  Why use it?  How do I use it correctly?
  3. 3. What is XHTML?  Extensible HyperText Markup Language  Combination of HTML and XML  The elements from HTML  The syntax from XML
  4. 4. Why should I care?  Based on industry standards  Cross browser support  Validated and proper code  Will run properly on all XML devices
  5. 5. Basic Structure  One root element per document  Properly nested elements  Closed elements  lowercase elements  More syntax
  6. 6. One root element  The basic mandatory structure <!DOCTYPE – more in a second> <html> <head> <title></title> </head> <body> </body> </html>
  7. 7. Properly Nested  BAD <p> This <strong><em> is</strong></em> fun. </p>  HAPPY FUN TIME <p> This <strong><em> is </em></strong> fun. </p>
  8. 8. Closed Elements  BAD <p>Paragraph 1 <p>Paragraph 2 <br> <hr> <img src=“pic.jpg”>  HAPPY FUN TIME <p>Paragraph 1</p> <p>Paragraph 2</p> <br /> <hr /> <img src=“pic.jpg” />
  9. 9. lowercase elements  BAD <P> another paragraph with an image <Img Src=“pic.jpg” /> </p>  HAPPY FUN TIME <p> another paragraph with an image <img src=“pic.jpg” /> </p>
  10. 10.  HAPPY FUN TIME <table width=“100%”> </table> <input checked=“checked” /> <option selected=“selected”> </option>  BAD <table WIDTH=100%> </table> <input checked> <option SELECTED> </option> More syntax  Attribute names must be lowercase, their values quoted, and no “minimization”
  11. 11. DOCTYPE  Only really have to worry about this if you create the page from scratch  Don’t really worry about what everything means except for… <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/ xhtml1-transitional.dtd">
  12. 12. Now What?  XHTML Cheat Sheet v1.03 - http://floele.flyspray.org/htmlcheatsheet.pdf  Official HTML 4 page – http://www.w3.org/TR/html4/  Official list of elements (HTML 4) - http://www.w3.org/TR/html4/index/elements.html  Official list of attributes (HTML 4) - http://www.w3.org/TR/html4/index/attributes.html  Official XHTML 1 page – http://www.w3.org/TR/xhtml1/
  13. 13. Who am I?  C. Todd Barber  Webmaster  University of Tennessee Health Science Center  Memphis, TN 38163  http://www.utmem.edu  Also at  http://ctbarber.com  http://twitter.com/ctbarber
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×