XHTML and HTML 5




CS174

Chris Pollett

Aug 28, 2013

Outline

Standard XHTML 1.1 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

The head of an XHTML or HTML5 document

Kinds of Meta Information

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.

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.

More HTML tags (Inline tags)