CS174
Chris Pollett
Aug 28, 2013
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.
Head's of documents can also have meta tags.
<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, NOCACHE, NOSNIPPET, NOODP, NOYDIR . Some of these commands can also be specified in a robots.txt file. ROBOTS and these values are case insensitive.-->
Rather than use ROBOTS in the above you can also give directives for specific robots. For example, you could replace robot with googlebot.
In addition to the above meta tags, we will see later in the semester how aspects of how the screen renders in a mobile phone can be affected by meta tags.
<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 -->
<a href="http://www.somewhere.com/">somewhere</a>
<img src="myphoto.gif" alt="This is a picture of me" />