XHTML and HTML 5




CS174

Chris Pollett

Sep. 1, 2010

Outline

Standard XHTML Document Structure

XML declarations:

<?xml version ="1.0" encoding="utf-8" ?>
<!-- as not supported by some old 
   browsers validators doesn't usually check this -->

SGML DOCTYPE. This says which Document Type Definition will be used:

<!DOCTYPE html  PUBLIC "-//W3C//DTD XHTML 1.1//EN"
 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 

The XHTML document:

<html xmlns="http://www.w3.org/1999/xhtml" >
		<!-- might have namespaces for other things like SVG -->
<head>
	<title>name of my document</title></head>
<body><!--actually page stuff--></body>
</html>

Minimal HTML 5 Document

<!DOCTYPE html>
<html>
    <head>
        <title>Simple HTML</title>
        <meta charset="utf-8" />
    </head>
    <body>
    <h1>Example HTML 5 document.</h1>
    </body>
</html>

The head of an XHTML or HTML5 document

Kinds of Meta Information

<meta name="Author" content="who wrote the page" />
<meta name="description" content="how I would like the search 
   engines to describe my page. " />
<meta name="keywords" content="cool site" /> 
   <!--Key terms search engines should index this site with. 
    Unfortunately, not supported except maybe by inktomi -->
<meta name="ROBOTS" content="comma separated list of 
   what would like crawler to do" /> 
   <!-- Example commands NOINDEX, NOFOLLOW, 
     can also do in a robots.txt file-->

More Meta Information

The body of a web page

More on Block level elements

Getting Round Objects and Other Effects

More effects

What tags can go into the body of a web page?

<h1></h1> - <h6></h6>
heading tags to give a heading title for a section. These must be properly nested.
  <h1>heading1</h1> 
	<h2>heading 2</h2>
		<h3>heading</h3>
  <!--this is okay -->
<div></div>
used to specify a related section of text.
<p></p>
used to specify a paragraph.
<blockquote></blockquote>
used to indent large quotations.
<ul></ul> <ol></ol>
unordered and ordered lists. Has a type tag to specify things like circle, square bullets,, A, I, a, i 1. Elements in list are specified with <li></li>. There are also <dl></dl> definition lists.
<form></form>
used to make a web form.
<table></table>
used to make a table in a web page.