HTML




CS174

Chris Pollett

Aug 29, 2022

Outline

HTML/XHTML

HTML Variants

Basic Syntax

Quiz

Which of the following is true?

  1. .htaccess is the protocol used by a browsers to request documents on the web.
  2. Based on the description in the syllabus, it is possible to use none of the insurance points you acquire through in-class exercises, it is also possible to use all of them.
  3. All versions of HTTP only use the TCP protocol to send data over the web.

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

Where to Edit HTML

How to "run" your HTML

What does it mean for your HTML to "work"?

The head of an XHTML or HTML5 document

We have now looked at a simple HTML document. This consisted of a DOCTYPE declaration, an html tag pair with head and body tag pairs as its contents. The head has to have at least a title tag within it. Let's now examine what can go in the head and body tags pairs in detail, beginning by looking at the head tag:

Kinds of Meta Information

Heads of documents can also have (but are not required to have) meta tags.

<meta name="author" content="who wrote the page" />
<meta name="generator" content="ChrisTextTool" /> 
   <!--What software was used to generate this html -->
<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 really used by search engines anymore -->
<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.

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.

The WHATWG Meta Extensions page contains a relatively complete list of values for the name and content attribute.

More Meta Information