Lecture 10: Comments, Special Characters, and Meta Data

Overview:

  1. (X)HTML Comments
  2. Special Characters
  3. Overview of Meta Tags
  4. Describing a Document
  5. Indicating a Content Type
  6. Giving Instructions to Bots
  7. Redirects
  8. Caching and Expiration

(X)HTML Comments

Special Characters

Overview of Meta Tags

Attribute Usage and Effect Values Accepted Default Deprecated?
content This required attribute gives the information about the document or the instructions to the device/program reading the file. Text Depends on usage Not deprecated
http-equiv Used for instructions to the device/program; typically these are for HTTP header information. Text   Not deprecated
name Defines the type of information about the document. Text   Not deprecated

Describing a Document

Indicating a Content Type

Giving Instructions to Bots

Redirects

Caching and Expiration

Full Example:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>Comments, Special Characters, and Meta Tags Example</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="robots" content="noindex,nofollow" />
    <meta http-equiv="cache-control" content="no-cache" />
    <meta http-equiv="pragma" content="no-cache" />
    <meta http-equiv="expires" content="-1" />
    <meta name="keywords" content="comments, special characters, meta tags,
    ampersand" />
    <meta name="description" content="An example showing comments, special
    characters, and meta tags" />
    <meta http-equiv="refresh" content="5; URL=http://www.google.com" />
    <!-- Author: Jason Withrow -->
</head>
<body>
    <!-- Example of an ampersand -->
    <p>This is an ampersand: &amp;</p>

    <!-- Notice of redirect to Google -->
    <p>The page will change to Google (www.google.com) in 5 seconds.</p>
</body>
</html>

See how this example renders