Cover | Table of Contents | Colophon
http://host/path
http://host/path
scheme://host/path/extra-path-info?query-info
http; for FTP, the scheme is
ftp.
http://www.w3.org.
<html> tag enclosing the document
header and body:
<html> <head> <title>Barebones HTML Document</title> </head> <body> <p> This illustrates in a very <i>simple</i> way, the basic structure of an HTML document. </p> </body> </html>
<head> and
<body> tags. The head is where you give your
HTML document a title and where you indicate other parameters the
browser may use such as script and style sheets. The body is where
you put the actual contents of the HTML document. This includes the
text for display and document control markers (tags) that describe
the text elements. Tags also reference media files like graphics and
sound, and indicate the hot spots (hyperlinks or
anchors) that link your document to other
documents.
< and
>). The simplest elements are nothing more than
the tag name enclosed in brackets, such as
<head> and <i>.
More complicated tags have attributes, which may have specific values
defined by the author to modify the behavior of an element.
<a href="http://www.ora.com/catalog.html" > <h1 align="right"> <input name="filename" size="24" maxlength="80"> <link title="Table of Contents">
href attribute.
<i> tags:
<i>This text in italics.</i>
<b>) appears in the text of a link
(<a href=...>) contained in a paragraph:
<p> This is some text in the body, with a <a href="another_doc.html">link, a portion of which is <b>set in bold</b></a> </p>
<p>
tag to start a paragraph, and the </p> tag
to end it, you can easily omit the </p>,
because HTML browsers will generally infer them. However, XHTML
requires both <p> and
</p> tags for all paragraphs, without
exceptions.
</p> tags and still have browsers
parse them without complaint, they will continue to do so.
www.w3.org, or to the book HTML and
XHTML: The Definitive Guide.
<script> element or
loaded from a separate file. A special set of common element
attributes point to a script when their event is triggered. These
attributes are called event handlers.
<a> tag called
onMouseOver
<a href=doc.html DEFANGED_OnMouseOver="document.status='Click me!'; return true">
class=name
dir=dir
ltr) or right to left (rtl).
id=name
lang=language
onclick=applet
ondblclick=applet
onkeydown=applet
onkeypress=applet
onkeyup=applet
onmousedown=applet
class=name
dir=dir
ltr) or right to left (rtl).
id=name
lang=language
onclick=applet
ondblclick=applet
onkeydown=applet
onkeypress=applet
onkeyup=applet
onmousedown=applet
href attribute) or fragment
identifier (name attribute) within a document.
accesskey
=char
charset
=encoding
coords
=list
href
=url
hreflang
=language
name
=string
rel
=relationship
rev
=relationship
shape
=shape
circ, circle,
poly, polygon,
rect, or rectangle.
tabindex
=value
target
=name
<frameset> and
<frame>. The
<noframes> element provides alternative
content for nonframes browsers. This is a requirement for HTML 4.0
and later and should contain functional content, or a link to it,
instead of telling someone to get a browser that supports frames.
<frameset> tag
let you define the number and initial sizes for the columns and rows
of frames. The <frame> tag defines what
document—HTML or otherwise—initially goes into the frame,
and is where you may give the frame a name to use for hypertext link
targets.
<html>
<head>
<title>Frames Layout</title>
</head>
<frameset rows="60%,*" cols="65%,20%,*">
<frame src="frame1.html">
<frame src="frame2.html">
<frame src="frame3.html" name="fill_me">
<frame scrolling=yes src="frame4.html">
<frame src="frame5.html">
<frame src="frame6.html">
<noframes>
You are using a browser that does not support frames.
<a href="frame1.html">Take this link</a> to the first
HTML document in the set.
</noframes>
</frameset>
</html>
<frameset> tag defines the collection of
frames or other framesets in a document. Framesets may be nested,
providing a richer set of layout capabilities. The
<frameset> tag replaces the
<body> tag in a document. You may not
include any other content except valid
<head> and
<frameset>
content.
<frameset> tag uses two attributes to let
you define the size and number of columns (cols)
and rows (rows) of either frames or nested
framesets to display in the document window. These attributes divide
a frameset in a grid-like or tabular format. Both attributes accept a
quote-enclosed, comma-separated list of values that specify either
the absolute or relative width (for columns) or height (for rows) for
the frames. The number of attribute values determines how many rows
or columns of frames the browser displays in the document window.
rows and cols
attributes can be specified in one of three ways: as an absolute
number of pixels, as a percentage of the total width or height of the
frameset, or as a portion of the space remaining after setting aside
room for adjacent elements.
<frameset rows="150,300,150" >
<frameset> tags. Any frame
within a frameset can contain another frameset.
<frameset> tags
with row specifications within a top-level
<frameset> that specifies the columns:
<frameset cols="50%,*" >
<frameset rows="50%,*">
<frame src="frame1.html">
<frame src="frame2.html">
</frameset>
<frameset rows="33%,33%,*">
<frame src="frame3.html">
<frame src="frame4.html">
<frame src="frame5.html">
</frameset>
</frameset>
<noframes> tag, if applicable). The
<frame> tags provide URL references to the
individual documents that occupy each frame.
<frame> tags are standalone elements, and
therefore do not require a closing tag.
<frame> tags inside a
<frameset> are important.
<frame>
tags that do not contain an src document attribute
and for those trailing ones in a frameset that do not have an
associated <frame> tag. Such orphans,
however, remain empty; you cannot put content into them later, even
if they have a target name attribute for display
redirection.
<frame> tag.
src=
document_name
src
attribute is a URL of the document that is to be displayed in the
frame. The document may be any valid HTML document or displayable
object, including images and multimedia. The referenced document may
itself be another frame document.
name=
frame_name
name
attribute labels the frame for later reference by a
target attribute in a hypertext link anchor
<a> tag. If a link that targets a
frame's name is selected, the document is displayed
in the named frame. The value of the name
attribute is a text string enclosed in quotes.
noresize
<frameset> tag, users can manually alter the
size of a column or row of frames. To suppress this behavior, add the
noresize attribute to the frame tags in the row or
column whose relative dimensions you want to maintain.
scrolling=[yes,no,auto]
<frame> tag includes an attribute that
allows you to name the frame. A hypertext link in another frame can
load its referenced document into the named frame by using the
target attribute in the
<a> tag. For example:
<frame src="frame.html" name="display_frame">
<a href="file.html" target="display_frame">
target attribute for the
<base> tag in the
<head> of your document. Adding a target to
the <base> tag sets the default target for
every hypertext link in the document that does not contain an
explicit target attribute.
<frame> or
<frameset> via a CSS stylesheet or inline
style. Internet Explorer and Netscape Navigator both support
attributes that adjust the style of the borders that surround frames.
These attributes were introduced in earlier browsers prior to a
standardized specification. Although they have the same functions,
the attributes are slightly different for each browser.
frameborder attribute to toggle between 3D borders
and simple rules for borders. The default is to use 3D borders; a
value of no gives simple borders. This attribute
can be placed in either the <frameset> tag
or in a <frame> tag. A setting in an
individual <frame> overrides an outer
<frameset> setting.
<frameset> and
<frame> with the
bordercolor attribute.
<frameset> tag, you can set the width of the
borders in a whole frameset with the border
attribute. The default width is 5 pixels. To achieve borderless
frames in Netscape, set border=0 and
frameborder=no.
frameborder in the
<frameset> and
<frame> tags, but the values are
1 for 3D borders and 0 for
simple ones. In the <frameset> tag, you can
set the amount of space between frames with the
framespacing attribute. By setting
framespacing=0 and
frameborder=0, you can achieve borderless frames.
<img> would be. The tag for a floating frame
is <iframe>, and it requires a closing tag.
The attributes include all of the regular
<frame> attributes, and the sizing,
alignment, and placement attributes of
<img>.
<table>,
<caption>, <tr>,
<th>, and <td>. The
<table> tag surrounds the table and gives
default specifications for the entire table such as background color,
border size, and spacing between cells. The optional
<caption> tag is placed within the
<table> tags and provides a caption for the
table. <tr> tags denote each row of the
table and contain the tags for each cell within a row.
<th> and <td>
describe the table cells themselves, <th>
being a header cell and <td> being a regular
cell. <th> and <td>
tags surround the information that is displayed within each table
cell.
<th> or
<td> tags contained within a
<tr>. If a table cell spans more than one
row (using the rowspan attribute), the affected
rows below it automatically accommodate the cell, and no additional
cell tag is needed to represent it in those rows.
align attribute. align accepts
two values, left and right.
These values instruct the browser to align the table with either the
left or right margin of the text flow around it. Text then flows
along the opposite side of the table, if there is
room.
hspace and
vspace attributes add extra space between the
table and surrounding content. hspace adds space
to the left and right sides of the table; vspace
adds space above and below it. The value of each attribute is given
as an integer number of pixels.
width attribute
can give you some control over the width of a table. Tables are
normally rendered at the width that fits all the contents. The
width attribute allows you to widen the table
beyond the default size to occupy a set number of pixels or a
percentage of the window's width. For example:
<table width="100%" >
<p>), the
browser usually accommodates your request.
border attribute to
<table> controls the borders within and
around the table. Simply using border with no
attributes adds default borders to a table, which are not rendered
the same in any two browsers. You can set border width by giving the
attribute an integer number of pixels as a value. The
caption to your table by using
a <caption> tag within a
<table>. The default placement of the
caption for Netscape and Internet Explorer is above the table and
centered with it. The placement and alignment of the caption is
controlled by special alignment attributes that differ between the
browsers.
align attribute accepts two values:
top and bottom. These allow you
to put the caption above or below the table. The default value is
top.
align attribute for horizontal placement of the
caption. It accepts values of left,
right, and center (the
default). The vertical positioning of the caption in Internet
Explorer is controlled by a special valign
attribute, which ac