CS174
Chris Pollett
Sep. 1, 2010
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>
<!DOCTYPE html> <html> <head> <title>Simple HTML</title> <meta charset="utf-8" /> </head> <body> <h1>Example HTML 5 document.</h1> </body> </html>
Ex: <link rel="shortcut icon" href="http://www.cs.sjsu.edu/faculty/pollett/favicon.ico" />
Ex: <base href="http://www.my.com/stuff/" />Now a link <a href="file.html" >file</a> would have the implicitly base address in front of it.
<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-->
<meta http-equiv="foo" content="bar" />is treated by a browser as if the response header field:
foo: barwas sent.
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="Expires" content="Wed, 30 Aug 2006 14:25:27" /> <meta http-equiv="refresh" content="10;url=http://www.cs.sjsu.edu/" />
<h1>heading1</h1> <h2>heading 2</h2> <h3>heading</h3> <!--this is okay -->