A Complete Guide to Web Design

(やまだぃちぅ) #1
98 Chapter 6 – Structural HTML Tags

Using Tags


Web Design in a Nutshell, eMatter Edition

IE uses the attributesleftmargin(affects space on left and right) andtopmargin
(affects space on top and bottom). Navigator 4.0 uses the more standardmargin-
width and marginheight for the same measurements, respectively. To set
margins for both browsers, it is necessary to use all four attributes. In the
following example, the margins are turned off for both browsers by setting the
margins to 0 :
<BODY MARGINWIDTH=0 MARGINHEIGHT=0 LEFTMARGIN=0 TOPMARGIN=0>

Using Tags


The<meta>tag has a wide variety of applications, but is primarily used to include
information about a document, such as the creation date, author, or copyright
information. The data included in a <meta> tag is useful for servers, web
browsers, and search engines but is invisible to the reader. It must always be
placed within the<head> of the document.
A document may have any number of<meta>tags. There are two types of
<meta>tags, using either thenameorhttp-equivattribute. In each case, the
contentattribute is necessary to provide a value (or values) for the named infor-
mation or function. The examples below show basic<meta>tag syntax. In the
following sections, we will look at each type of meta tag and its uses.
<META HTTP-EQUIV="name" CONTENT="content">
<META NAME="name" CONTENT="content">

The http-equiv Attribute


Information provided by anhttp-equivattribute is added to the HTTP response
header. The HTTP header contains information the server passes to the browser
just before it sends the HTML document. It contains MIME type information and
other values that affect the action of the browser. Therefore, thehttp-equiv
attribute provides information that somehow affects the way the browser handles
your document.
There are a large number of predefinedhttp-equivtypes available. This section
will look at just a few of the most useful. For a complete listing, see the Dictio-
nary of HTML META Tags athttp://vancouver-webpages.com/META/.

Meta tags for client-pull

Client-pull refers to the ability of the browser (the client) to automatically request
(pull) a new document from the server. The effect for the user is that the page
displays, and after a period of time, automatically refreshes with new information
or is replaced by an entirely new page. If you string documents with client-pull
instructions and set very short time intervals, you can create a sort of slide show
effect. Client-pull was once used for rudimentary animation in the early days of
the Web, but now that there are better alternatives the client-pull method is rarely
used for animation. Client-pull is still a handy technique for redirecting old URLs
to new ones. If you retire content at a given URL, you may want to redirect users
to a different page, rather than just allowing a 404 error.
Free download pdf