Hypertext Markup Language (HTML) is the most important component of the Web. It is responsible for providing the "formatting" to the pages you see every day on the Web.
HTML does not provide the formatting control you would expect, simply because different browsers render HTML in different ways. The task has been to abuse and creatively use tags to provide a desired look to a page. Creative types will find that HTML is fairly limited in what it can do; however, it is amazing to see the level of quality that can be brought out given the current control. The markup language is rapidly evolving to allow for more page-oriented layout, while keeping with the device-independent intent of HTML. Designers will always find a way of getting their intentions across.
Early in the Web, there was a lot of concern with being compatible with low resolution browsers such as Lynxa text-only browser. Lynx has been used for a long time as a way of testing HTML for universal compatibility. This meant that you could not rely in the nonstandard HTML tags for your formatting or on graphic items alone for navigation. This interestwhile still kept active by many peopleis quickly dying out. I know of many Web service providers that will implement sites with a compatibility set to Netscape or Microsoft Internet Explorer. I believe that there's room for everybody, but the implementation specifications should really be set by the owner of the site and the intended target audience. This is due mostly to the evolution of the Web and supporting technologies. Personal bandwidth has increased very quickly, with 28.8Kbps modems becoming the low end, and faster technologies enabling higher bandwidth than it was thought possible over standard copper wires a few years ago. With the advent of inexpensive high bandwidth, visitors will demand more complex sites that offer a variety of multimedia presentation systems.
While many people will disagree, the reality of the Web is that much of the interest is based on the graphic appeal of a Web site. For once the graphical user interface (GUI) provided by a particular page is appealing, letting the visual types have more fun. Although Lynx does provide a serviceable interface to information you need while behind a terminal, the use of graphical browsers such as Netscape and Internet Explorer are where the technology is at.
This means that the basic design target has been changed to accommodate the features implemented by these browsers, perhaps at the expense of losing usability on the lower-end browsers. However, this has always been the argument in computers. Before GUI applications were popular, the issues were why did you need a mouse. Now that GUIs are the standard, many people find it dreadful to downgrade to a command prompt, although it may be very helpful sometimes. The Web is not TV; it is interactive. A great deal of its power comes from the its multimedia capabilities and its ability to give a feeling of being there. This can only be accomplished with graphic-capable browsers.
So to what standard should you develop your pages? It really depends on who is your target audience. If your message is too important not have it seen by some users, yet you want an enhanced site, the solution is simple: You'll need to prepare two or three versions of your pages that can be used with different levels of richness. This way you won't limit or stifle the more advanced browsers. You'll be able to provide features that will make it easier for people visiting your site to navigate through it. If their browser doesn't provide the proper support, then you'll have a scaled down version of your Web site that provides the information more plainly.
This doesn't mean the site is less capable; it just means that you are giving your users options. This also gives you the opportunity to provide different bandwidth versions of your site, which will allow people with the bigger intakes to enjoy more complex pages. Bandwidth conservation should still be a priority. A site should be designed to use the least amount of bandwidth possible given the design intent. This will allow your material to zip through. Your users will love it, and your server will be able to serve more users.
With that thought in mind, here's an HTML reference manual. This appendix is not intended as an HTML style guide. It assumes that you have a basic understanding of HTML. Most of the options you see will only work with Netscape or Microsoft Internet Explorer. At the current time of this writing, Microsoft just released, (Aug 13, 1996), Internet Explorer 3.0. Netscape, following suit, also will unleash their new Navigator. As I see it now, the competition is red hot. Both products have their advantages, and they offer an almost 99 percent feature match. I like them both equally well. However, I think in terms of the future, Netscape will have to be much further ahead to justify its price. Explorer is free and will ship with every new PC, giving it the price and distribution advantage.
HTML is a markup language, which means that text is marked up with tags to produce the desired results. You can create HTML with any good text editor. However, there are many editors specially made for editing and marking up HTML. HTML is fairly easy to learn. HTML markup tags surround text or other items that they affect. Tags are a formatting directive enclosed in angle brackets (< and >). Most tags have an opening and a closing tag. Opening tags are just the name of the directive. Closing tags prefix a forward slash (/) to the name of the directive. If the closing tag is optional, it is better to close them anyway in most cases. This will make your HTML style more consistent and readable, and will reduce problems associated with a missing close tag. Here's the basic syntax of any HTML tag:
<tag>some object</tag>
Some tags may contain additional options. For example, the <P> tag, which defines a new paragraph, allows some simple formatting in some browsers. These options are specified as <P ALIGN=center>...</P>. This simply says that the paragraph should align center. The closing tag never takes any arguments.
Formatting tags can be nested with other tags to produce compound results. However, the nesting order is important. Some tags don't like to be nested. Each tag described in this appendix will include an elements allowed within and an element is allowed inside table. The first lists all the HTML elements that can nest inside the currently described element. The second lists all the HTML elements that can contain the currently described element.
HTML documents have a very precise structure; they have a head and a body. In addition, HTML 3.2 requires that the first line of any HTML document you write contains the following line:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
This specifies the version of HTML that you are using among other things. The basic structure for an HTML document is:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> infomration about your document </HEAD> <BODY> content, what users see </BODY> </HTML>
The first thing you do is set the document type. Then that the document contains HTML markup. The HTML surrounds your document's content. Notice that HTML contains the HEAD and BODY sections.
The HEAD element of an HTML document contains information about the document itself. This information is only usable by the browser and other programs. For example, browsers render the title of your document based on a TITLE element inside the HEAD section.
The BODY element contains your contentinformation you want displayed to your users. This is what you see on your browser.
The simplest HTML page you could write that does something useful is HelloWorld.html. This is what such a page would look like in HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> <TITLE>Hello World in HTML </TITLE> </HEAD> <BODY> <P>Hello World!</P> </BODY> </HTML>
This example does a couple of things. It sets up the basic structure of the document and uses the TITLE element in the HEAD section. The TITLE element titles the document, and the browser uses this information to put a title in the windows title bar.
In the BODY section, our small sample starts a paragraph with the <P> tag, and then prints the words Hello World!. It finishes the paragraph with the optional close paragraph tag, </P>. There are many more elements that will help you control the organization and formatting of your document, but they all basically work in the same form.
The list of elements that follows describes most, if not all, the elements as of HTML 3.2 that are implemented in the two most popular graphic browsers (Netscape and Internet Explorer). In the interest of saving space, all of the figures will show the HTML element's use with IE 3.0.
The A element defines a hyperlink anchor that references a resource. The referenced resource, or destination, can be located in the current document or in a different uniform resource locator (URL) altogether. The A element is the fundamental building element of the Web. It allows you to easily jump from one document to another.
The basic syntax of the A element specifies an anchor address or Uniform Resource Identifier (URI). The URI is optionally followed by a pound symbol (#) and a token called a fragment identifier, which specifies a particular location within the referenced resource (a bookmark).
The HREF attribute sets the target to be a URI or a local reference within the same document. Local references are specified by prefixing a token with a # symbol. Destinations or fragment identifiers are specified by using another <A> tag with the NAME attribute.
Activating a local reference will jump the browser to the location of the reference be it by scrolling the current document or by loading the referenced URL. Anchors are represented graphically by underlined text, but this visual clue is user controlled and can be turned off in most browsers. The A element requires a closing tag. A elements cannot nest. See Figure D.1 for an example of the A element.
Figure D.1. The A element.
Syntax: | <A HREF=url NAME=#token REL=relation REV=relation TARGET=window-name TITLE=title>...</A> |
The A element has the following options:
Option | Description |
HREF=url | Specifies a destination address. Resources are specified in URL format or as #name for a reference within the current document. |
NAME=name | Defines a named anchor for use as a hyperlink destination. |
REL=relation | Defines a relationship of the HREF (source) to the anchor (destination), which is authorized and recognized by the source document. |
REV=relation | Defines a relationship anchor (destination) to the HREF (source), which is desired and claimed by the destination, but needs to be verified by the source. |
TITLE=title | Informational token, used to describe the HREF |
TARGET=window | Netscape 2.0 Extension that defines the window name for use by the retrieved hyperlink. If the named window is not yet open, Navigator will open a new window and assign this name to it. |
The A element is allowed within these elements:
APPLET, B, BIG, BR, CITE, CODE, DFN, EM, FONT, I, IMG, INPUT, KBD, MAP, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TEXTAREA, TT, U, and VAR
The element is allowed inside the following:
ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, DD, DFN, DIV, DT, EM, FONT, FORM, H1...H6, I, KBD, LI, P, PRE, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TD, TEXTFLOW, TH, TT, U, and VAR
<A NAME="accesslink">This is a text hyperlink to <A HREF="http://www.accesslink.com">accessLINK, inc.</A> <P> Graphics can be clickable images with a border: <A HREF="#accesslink"><IMG SRC="websiteby.gif" ALT="Web Site By AccessLink"></A> <P> Or without: <A HREF="http://www.accesslink.com"><IMG SRC="websiteby.gif" BORDER=0></A>
The ADDRESS element is used to render multiline contact information (such as a name, address, and signature). This element acts much like a paragraph; it automatically puts breaks before and after itself. The ADDRESS element requires a closing tag.
Figure D.2. The ADDRESS element.
Syntax: | <ADDRESS>...</ADDRESS> |
The ADDRESS element is allowed within these elements:
A, APPLET, B, BIG, BR, CITE, CODE, DFN, EM, FONT, I, IMG, INPUT, KBD, MAP, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TEXTAREA, TT, U, and VAR
The element is allowed inside the following:
BLOCKQUOTE, BODY, CENTER, DIV, FROM, TD, and TH
<ADDRESS> accessLINK, inc. <BR> N70 W6340 Bridge Rd.<BR> Cedarburg, WI 53012 <BR> Voice: 414.376.4590 </ADDRESS>
The APPLET element specifies the Java application to load and execute for Java-enabled browsers. This element allows you to embed a Java applet right into HTML documents. Java applets are usually used to dynamically provide additional functionality to a browser, often in the form of an animation or some other adornment. However, Java applets can also be used to provide client-side processing, such as verification, to ensure that all items on a form have been completed by the visitor prior to sending it back to the server. The content of the APPLET element is displayed if the applet cannot be executed.
Parameters can be passed to an applet by using the PARAM element inside the APPLET element. You can specify multiple PARAM elements to provide multiple parameters to the applet. The APPLET element requires a closing tag.
Syntax: | <APPLET ALIGN=alignment ALT=text CODEBASE=url CODE=appletFile HEIGHT=n HSPACE=n NAME=appletInstance VSPACE=n HSPACE=n WIDTH=n>...</APPLET> |
Options for APPLET include the following:
Option | Description |
ALIGN=alignment | Specifies the alignment in the applet window. The various legal options are TOP, MIDDLE, BOTTOM, LEFT, RIGHT. |
ALT=text | Sets the alternate text displayed when the applet cannot be loaded. |
CODE=appletFile | Specifies the Java class to load and execute. |
CODEBASE=url | Specifies the base URL of the appletthe directory where the applet is located. |
HEIGHT=n | Sets the initial suggested height of the applet window in pixels |
HSPACE=n | Sets the horizontal space (in pixels) reserved for a gutter around the applet. |
NAME=appletInstance | Name of the applet instance. This name allows multiple applets on the same page to communicate. |
VSPACE=n | Sets the vertical space (in pixels) reserved for a gutter around the applet specified in pixels. |
WIDTH=n | Sets the initial suggested width of the applet window in pixels. |
The APPLET element is allowed within these elements:
PARAM and TEXTFLOW
The element is allowed inside the following:
A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, DD, DFN, DIV, DT, EM, FONT, FORM, H1...H6, I, KBD, LI, P, PRE, SAMP, SMALL, STRIKE, STRONG, SUB, SU, TD, TEXTFLOW, TH, TT, U, and VAR
... <applet codebase="../LED" code="LED.class" width=500 height=48 align=center> <param name="script" value="../scripts/Demo.led"> <param name="border" value="2"> <param name="bordercolor" value="100,130,130"> <param name="spacewidth" value="3"> <param name="wth" value="122"> <param name="ht" value="9"> <param name="font" value="../fonts/default.font"> <param name="ledsize" value="3"> <hr> If you were using a Java-enabled browser, you would see an animated scrolling text sign that looks like this: <BR> <IMG SRC="LEDSign.gif"> <hr> </applet> ...
The AREA element is used to implement client-side image maps. The various elements allow you to define regions in an image that, when activated, will hyperlink the resource identified by the HREF attribute. When multiple AREA elements in the same MAP overlap, the first encountered takes precedence. This can be useful to define complex areas.
The AREA element is allowed within a MAP element only. The AREA closing tag is optional.
Syntax: | <AREA SHAPE=shape COORDS=coords HREF=url|NOHREF [TARGET=window]> |
Options for AREA include the following:
Option | Description |
ALT=text | Sets the alternate text displayed if the browser doesn't accept images. |
COORDS=coords | A comma-separated list of coordinates. Format is dependent on the shape used. |
RECT: x,y,w,h: Upper-left corner x,y with a width and height w,h. | |
CIRCLE: x,y,r: Circle centered at x,y with radius r. | |
POLY: x1,y1,x2,y2...xi,yi: Ordered coordinate pairs that define a closed polygon. | |
HREF=url | Specifies the hypertext destination of the specified area. |
NOHREF | Specifies an area that has no action. |
SHAPE=shape | Specifies the shape of the area. Possible values are |
RECT: rectangle | |
CIRCLE: circle | |
POLY: polygon | |
TARGET=window | Specifies that the target be loaded into the specified window. Possible values for window are |
window: Specifies to load the link into the named window. | |
blank: Creates the frame in a new unnamed window. | |
self: Loads the frame in the parent window. | |
parent: Loads in the parent window. | |
top: Loads in the top window. | |
The AREA element is allowed within the following element: | MAP |
The element is allowed inside the following: | None. The AREA element is not a container. |
Note that the USEMAP option requires a # sign (just like a local HREF) before the name of the fragment containing the map coordinates:
<AREA SHAPE=RECT COORDS="56,7,106,86" HREF="#b" ALT=b> <AREA SHAPE=CIRCLE COORDS="219,63,23" HREF="#e" ALT=e>
The B element provides emphasis by rendering its contents in boldface. The B element requires a closing tag.
Figure D.4. The B element.
Syntax: | <B>...</B> |
The B element is allowed within these elements:
A, APPLET, B, BIG, BR, CITE, CODE, DFN, EM, FONT, I, IMG, INPUT, KBD, MAP, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TEXTAREA, TT, U, and VAR
B is allowed inside the following:
A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, DD, DFN, DIV, DT, EM, FONT, FORM, H1...H6, I, KBD, LI, PRE, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TD, TXTFLOW, TH, TT, U, and VAR
<B>Bold</B> can be used on normal text.<BR> <PRE> You can also use <B>Bold</B> on preformatted text. </PRE> <BR> You can even use <B>Bold</B> and <I>Italics</I> <B><I>together</I></B>!<BR>
The BASE element provides an absolute URL from which to interpret any relative URL links specified in the document. This allows the original document to be moved, while preserving all relative links. The default base address is the URL used to access the document; however, when the document is moved or copied elsewhere, the default base URL is not correct. The BASE element is very useful in ensuring that hyperlinks don't break when a page is moved or is mirrored by an user.
This element is only allowed within a HEAD element.
Syntax: | <BASE HREF=url [TARGET=window]> |
Options include the following:
Option | Description |
HREF | Specifies the base URL |
TARGET | Netscape 2.0 extension that allows to define a named target window for each hyperlink in the document that doesn't set an explicit TARGET attribute. |
The BASE element is allowed within these elements:
Not applicable. Element is not a container.
The element is allowed inside the following:
HEAD
<BASE HREF="http://www.somewhere.com/files/"> <BASE HREF="http://www.somewhere.com/files/ TARGET=_blank>
The BASEFONT element alters the base font that is used as a default for any nonspecifically formatted text.
Figure D.5. The BASEFONT element.
Syntax: | <BASEFONT COLOR=color NAME=name SIZE=n> |
Options include the following:
COLOR=color | Specifies the color of the base font. Colors are specified using hexadecimal notation for each component in the RGB channel in the following format: #RRGGBB, or by specifying one of the Microsoft Internet Explorer predefined colors: Aqua, Black, Blue, Fuchsia, Gray, Green, Lime, Maroon, Navy, Olive, Purple, Red, Silver, Teal, Yellow, White. |
NAME=name | Specifies the name of the font. |
SIZE=n | Specifies the size of the base font to be one of seven predefined sizes. The default size is 3, and the largest is 7. You can specify sizes relative to BASEFONT using the FONT element. n can range in size from 1 to 7, inclusive. |
The BASEFONT element is allowed within these elements:
None. BASEFONT is not a container element.
BASEFONT is allowed inside the following:
A, ADDRESS, B, BLOCKQUOTE, BODY, CITE, CODE, DD, DT, EM, FORM, H1, H2, H3, H4, H5, H6, I, KBD, LI, P, PRE, SAMP, STRONG, TT, and VAR
Here is some unadultered normal text (no basefont). <P> <BASEFONT SIZE=4> This is some text after BASEFONT size is set to 4. <BR> <FONT SIZE=+1>Here is size +1.</FONT><BR> <FONT SIZE=+2>Here is size +2.</FONT><BR> <FONT SIZE=+3>Here is size +3.</FONT><BR>
The BGSOUND element is a Microsoft Internet Explorer 2.0 extension which defines the audio file to be played as a background to the document.
Syntax: | <BGSOUND SRC=url LOOP=n> |
Options for BSOUND include the following:
SRC=url | Specifies the URL of the audio file to play. |
LOOP=n|INFINITE | Specifies the number of times the source sound will play while the document is displayed. The default is to play once, but you can also specify infinite for unlimited playback. There's no way of disabling the audio, except for turning off the volume or traveling to another page. |
The BGSOUND element is allowed within these elements:
None. BGSOUND is not a container element.
The element is allowed inside the following:
A, ADDRESS, B, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, COMMENT, DD, DFN, DT, EM, ENTITY, FONT, FORM, H1...H6, HEAD, I, KBD, LI, MARQUEE, P, SAMP, STRIKE, STRONG, TD, TH, TT, U, and VAR
<BGSOUND SRC="/sounds/my.mid" LOOP=INFINITE>
The BIG element specifies that the enclosed text be rendered one size larger than the current font. The BIG element requires a closing tag.
Figure D.6. The BIG element.
Syntax: | <BIG>...</BIG> |
The BIG element is allowed within these elements:
A, APPLET, B, BIG, BR, CITE, CODE, DFN, EM, FONT, I, IMG, INPUT, KBD, MAP, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TEXTAREA, TT, U, and VAR
BIG is allowed inside the following:
A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, DD, DFN, DIF, DT, EM, FONT, FORM, H1...H6, I, KBD, LI, P, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TD, TEXTFLOW, TH, TT, U, and VAR
... Big is good for initial caps, but it can also be used for emphasis. <BR><BIG>B</BIG>ig is good for initial caps, but it can also be used for <BIG>emphasis</BIG>. ...
The BLINK element specifies that the enclosed text be rendered using a blinking font. BLINK is a Netscape only extension. The BLINK element requires a closing tag.
Syntax: | <BLINK>...</BLINK> |
The BLINK element is allowed within these elements:
A, APPLET, B, BIG, BR, CITE, CODE, DFN, EM, FONT, I, IMG, INPUT, KBD, MAP, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TEXTAREA, TT, U, and VAR
BLINK is allowed inside the following:
A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, DD, DFN, DIF, DT, EM, FONT, FORM, H1...H6, I, KBD, LI, P, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TD, TEXTFLOW, TH, TT, U, and VAR
<P>This is normal text. <BLINK>Hello, this text blinks!</BLINK>
The BLOCKQUOTE element specifies that the enclosed text represents a block quote. Block quotes are rendered by indenting both the left and right margins. The BLOCKQUOTE element requires a closing tag.
Figure D.7. The BLOCKQUOTE element.
Syntax: | <BLOCKQUOTE>...</BLOCKQUOTE> |
The BLOCKQUOTE element is allowed within these elements:
A, ADDRESS, APPLET, B, BIG, BLOCKQUOTE, BR, CENTER, CITE, CODE, DFN, DIR, DIV, DL, EM, FONT, FORM, H1...H6, HR, I, IMG, INPUT, ISINDEX, KBD, LISTING, MAP, MENU, OL, P, PRE, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TABLE, TEXTAREA, TT, U, UL, VAR, and XMP.
BLOCKQUOTE is allowed inside the following:
BLOCKQUOTE, BODY, CENTER, DD, DIV, FORM, LI, TD, and TH
... <BLOCKQUOTE> "I said what I meant, and meant what I said. An elephant is faithful - 100 per cent" - Horton the Elephant </BLOCKQUOTE> ...
The BODY element contains the content of a document. It specifies the beginning and end of the document body. This contrasts with the HEAD of a document, which contains information about the document. All displayable elements should be included within the BODY section. The opening and closing of the BODY element is inferred, so it is optional. However, it is considered good style to open and close it.
Figure D.8. Some changes to the standard BODY settings.
Syntax: | <BODY ALINK=color BAGROUND=url BGCOLOR=color BGPROPERTIES=FIXED LEFTMARGIN=n LINK=color TEXT=color TOPMARGIN=n VLINK=color>...</BODY> |
The options available for BODY include the following:
ALINK=color | Specifies the color of the active link. Colors are specified in the HEX, 00-FF for each component of the RGB channel in the #RRGGBB format. |
BACKGROUND=url | Specifies an image to be used as the background. |
BGCOLOR=color | Specifies the background color of the document. Colors are specified in the HEX, 00-FF for each component of the RGB channel in the #RRGGBB format, or by specifying one of the Microsoft Internet Explorer predefined colors: Aqua, Black, Blue, Fuchsia, Gray, Green, Lime, Maroon, Navy, Olive, Purple, Red, Silver, Teal, Yellow, White. |
BGPROPERTIES=FIXED | Specifies that the BACKGROUND image be used as a watermark. The image is not replicated and remains stationary in the center of the window. |
LEFTMARGIN=n | Sets the margin for the left of the page. When set to zero, the left margin is set on the left edge of the window. |
LINK=color | Specifies the color of a normal link. Colors are specified in the HEX, 00-FF for each component of the RGB channel in the #RRGGBB format. |
TEXT=color | Specifies the color of normal text. Colors are specified in the HEX, 00-FF for each component of the RGB channel in the #RRGGBB format. |
TOPMARGIN=n | Sets the margin for the top of the page. When set to zero, the top margin is set on the top edge of the window. |
VLINK=color | Specifies the color of a visited or viewed link. Colors are specified in the HEX, 00-FF for each component of the RGB channel in the #RRGGBB format. |
The BODY element is allowed within these elements:
A, ADDRESS, APPLET, B, BIG, BLOCKQUOTE, BR, CENTER, CITE, DFN, DIR, DIV, DL, EM, FONT, FORM, H1...H6, I, IMG, INPUT, ISINDEX, KBD, LISTING, MAP, MENU, OL, P, PRE, SAMP, SCRIPT, SELECT, SMAL, STRIKE, STRONG, SUB, SUP, TABLE, TEXTAREA, TT, U, UL, VAR, and XMP
The element is allowed inside the following:
HTML
<BODY BGCOLOR="#FFFFFF" TEXT="#FF3333" LINK="00FF00" VLINK="#00FF00" ALINK="#00FF00"> <H1>BODY</H1> <HR> Here is a <A HREF="http://www.microsoft.com">link</A> to Microsoft. <P>(We changed the default text color to red, and the link color to green). </BODY>
The BR element inserts a line break and continues the rendering of objects that follow in the next line.
Figure D.9. The BR element.
Syntax: | <BR CLEAR=align-type> |
Options include the following:
CLEAR | The CLEAR attribute forces the line to break clear of floating images or tables. Possible values for the CLEAR attribute are |
LEFT: Move down until the left margin is clear. | |
ALL: Move down until all margins are clear. | |
RIGHT: Move down until the right margin is clear. | |
NONE: Do not clear the margins. |
The BR element is allowed within these elements:
Not applicable.
BR is allowed inside the following:
A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, DD, DFN, DIV, DT, EM, FONT, FORM, H1...H6, I, KBD, LI, P, PRE, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TD, TEXTFLOW, TH, TT, U, and VAR
<IMG SRC="websiteby.gif" ALT="Web Site By AccessLink" ALIGN=LEFT HSPACE=5> The BR element inserts a line break and continues<BR> rendering of objects that follow in the next line. The CLEAR attribute forces the line to break 'clear' of floating images or tables. This example uses a break element without a CLEAR attribute. The break is on the word 'continues.' <P> <IMG SRC="websiteby.gif" ALT="Web Site By AccessLink" ALIGN=LEFT HSPACE=5> The BR element inserts a line break and continues <BR CLEAR=ALL> rendering of objects that follow in the next line. The CLEAR attribute forces the line to break 'clear' of floating images or tables. This is an example of using a break element with a CLEAR attribute. Note how the text after the andlt;BRandgt; element is cleared past the image, as opposed to the previous example, where the text continued flowing around the image after the break.
The CAPTION element is used to label a table. The ALIGN attribute specifies the alignment of the caption. The CAPTION element requires a closing tag.
Figure D.10. The CAPTION element.
Syntax: | <CAPTION ALIGN=align-type>...</CAPTION> |
Options for CAPTION include the following:
ALIGN | The ALIGN attribute specifies what edge to place the caption relative of. |
LEFT: Places captions on the left. | |
RIGHT: Places captions on the right. | |
TOP: Places caption at the top. | |
BOTTOM: Places captions at the bottom of the image. This is the default setting. |
The CAPTION element is allowed within these elements:
A, APPLET, B, BIG, BR, CITE, CODE, DFN, EM, FONT, I, IMG, INPUT, KBD, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TEXAREA, TT, U, and VAR
CAPTION is allowed inside the following:
TABLE
... <CAPTION ALIGN=TOP>This is a caption on the top.</CAPTION> <TR> <TH>Name</TH> <TH>Address</TH> <TH>Telephone</TH> </TR> <TR> <TD>John Doe <TD>500 Elm Street <TD>555-1212 </TR> </TABLE> <P> <TABLE BORDER=1> <CAPTION ALIGN=BOTTOM>This is a caption on the bottom.</CAPTION> <TR> <TH>Name</TH> <TH>Address</TH> <TH>Telephone</TH> </TR> <TR> </TR> </TABLE> ...
The CENTER element centers objects between the left and right margin. The CENTER element requires a closing tag.
Figure D.11. The CENTER element.
Syntax: | <CENTER>...</CENTER> |
The CENTER element is allowed within these elements:
A, ADDRESS, APPLET, B, BIG, BLOCKQUOTE, BR, CENTER, CITE, CODE, DFN, DIR, DIV, DL, EM, FONT, FORM, H1...H6, HR, I, IMG, INPUT, ISINDEX, KBD, LISTING, MAP, MENU, OL, P, PRE, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TABLE, TEXTAREA, TT, U, UL, VAR, and XMP.
CENTER is allowed inside the following:
BLOCKQUOTE, BODY, CENTER, DD, DIV, FORM, LI, TD, and TH
<CENTER> <P> This text is centered. </CENTER>
The CITE element renders its contentsa reference to a book, paper, or other published materialsas a citation. The CITE element requires a closing tag.
Figure D.12. The CITE element.
Syntax: | <CITE>...</CITE> |
The CITE element is allowed within these elements:
A, APPLET, B, BIG, BR, CITE, CODE, DFN, EM, FONT, I, IMG, INPUT, KBD, MAP, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TEXTAREA, TT, U, and VAR
CITE is allowed inside the following:
A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, DD, DFN, DIV, DT, EM, FONT, FORM, H1...H6, I, KBD, LI, P, PRE, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TD, TEXTFLOW, TH, TT, U, and VAR
<CITE>Randall L. Schwartz - Learning Perl </CITE>
The CODE element renders its contents as computer code. It is intended for short words or phrases. Multiline listings should use the PRE element instead. CODE is usually rendered in a monospaced font. The CODE element requires a closing tag.
Figure D.13. The CODE element.
Syntax: | <CODE>...</CODE> |
The CODE element is allowed within these elements:
A, APPLET, B, BIG, BR, CITE, CODE, DFN, EM, FONT, I, IMG, INPUT, KBD, MAP, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TEXTAREA, TT, U, and VAR
The element is allowed inside the following:
A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, DD, DFN, DIV, DT, EM, FONT, FORM, H1...H6, I, KBD, LI, P, PRE, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TD, TEXTFLOW, TH, TT, U, and VAR
<CODE> % gcc -Wall -o run *.o -L./ -lcgic </CODE>
The COL element sets the properties of one or more columns on a table. It is used together with the COLGROUP element to set the properties of columns within a group. The end tag is not required.
Figure D.14. The COL element.
Syntax: | <COL ALIGN=align-type SPAN=n> |
Options include the following:
ALIGN=align-type | Specifies the alignment of text in the column. Legal values are |
CENTER: Centers text in the column. | |
LEFT: Text is left aligned in the column. | |
RIGHT: Text is right aligned in the column. | |
SPAN=n | Specifies the number of consecutive columns that this property affects. |
The COL element is allowed within these elements:
Not applicable.
The element is allowed inside the following:
COLGROUP
... <TABLE WIDTH=600 BORDER=1> <COLGROUP> <COL ALIGN=LEFT> <COL ALIGN=CENTER> <COL ALIGN=RIGHT> <TBODY> <TR> <TD>I am aligned on the left <TD>I am centered <TD>I am on the right </TR> <TR> <TD>I am aligned on the left <TD>I am centered <TD>I am on the right </TR> </TABLE> ...
The COLGROUP element sets properties for one or more columns. A closing tag is not required.
Figure D.15. The COLGROUP element.
Syntax: | <COLGROUP ALIGN=align-type SPAN=n> |
Options include the following:
ALIGN=align-type | Specifies the alignment of text in the column. Legal values are |
CENTER: Centers text in the column. | |
LEFT: Text is left aligned in the column. | |
RIGHT: Text is right aligned in the column. | |
SPAN=n | Specifies the number of consecutive columns that this property affects. |
The COLGROUP element is allowed within these elements:
Not applicable.
The element is allowed inside the following:
TABLE
... <TABLE BORDER=1 WIDTH=600> <COLGROUP ALIGN=LEFT SPAN=2> <COLGROUP ALIGN=RIGHT SPAN=2> <TBODY> <TR> <TD>I am aligned on the left <TD>I am aligned on the left <TD>I am on the right <TD>I am on the right </TR> <TR> <TD>I am aligned on the left <TD>I am aligned on the left <TD>I am on the right <TD>I am on the right </TR> </TABLE> ...
This element defines a comment. The text it contains is ignored unless it contains HTML code.
Syntax: | <COMMENT>...</COMMENT> |
The COMMENT element is allowed within these elements:
Any valid HTML; however, that makes for an oxymoron!
The element is allowed inside the following:
Anywhere.
<COMMENT>This is a comment</COMMENT>
If you really need comments, you may want to use SGML-style comments, which are supported by all browsers. SGML comments follow this syntax: <!-- comment -->. Any text inside the comment brackets won't print, and it can handle multiple lines of text between the tags:
<!-- some comment More comments -->
The DD (definition) element is used to provide a definition for a DT (definition term) within a DL (definition list) element. The closing tag is optional.
Figure D.16. The DD element.
Syntax: | <DD>...</DD> |
The DD element is allowed within these elements:
A, APPLET, B, BIG, BLOCKQUOTE, BR, CENTER, CITE, CODE, DFN, DIR, DIV, DL, EM, FONT, FORM, HR, I, IMG, INPUT, ISINDEX, KBD, LISTING, MAP, MENU, OL, P, PRE, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TABLE, TEXTAREA, TT, U, UL, VAR, and XMP
The element is allowed inside the following:
DL
<DL> <DT>Tree<DD>Vegetable <DT>Dog<DD>Animal <DT>Diamond<DD>Expensive mineral </DL>
The DFN element renders its content as a definition. The DFN closing element is required.
Figure D.17. The DFN element.
Syntax: | <DFN>...</DFN> |
The DFN element is allowed within these elements:
A, APPLET, B, BIG, BR, CITE, CODE, DFN, EM, FONT, I, IMG, INPUT, KBD, MAP, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TEXTAREA, TT, U, and VAR
The element is allowed inside the following:
A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, DD, DFN, DIV, DT, EM, FONT, FORM, H1...H6, I, KBD, LI, P, PRE, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TD, TEXTFLOW, TH, TT, U, and VAR
<P>Oxymoron: <DFN>"A combination of contradictory or incongruous words"</DFN>
The DIR element specifies a directory list of items, each starting with a LI element and none containing more than 20 characters. The list should display in columns (current third generation browsers don't). Ending tag is required.
Figure D.18. The DIR element.
Syntax: | <DIR><LI>...<LI>...<LI>......</DIR> |
The DIR element is allowed within this element:
LI
The element is allowed inside the following:
BLOCKQUOTE, BODY, CENTER, DD, DIB, FORM, LI, TD, and TH
<DIR> <LI>UNO
<LI>DOS <LI>TRES <LI>CUATRO <LI>CINCO <LI>SEIS <LI>SIETE <LI>OCHO <LI>NUEVE <LI>DIEZ! </DIR>
The DIV element is used to create divisions or groupings of related elements. The DIV element is intended to represent different kinds of containers (such as a chapter, section, abstract, or appendix) when used with the CLASS attribute. DIV allows the enclosed group of elements to be given a distinctive style. The closing tag is required.
Syntax: | <DIV ALIGN=align-type CLASS=container-type>...</DIV> |
Figure D.19. The DIV element.
Options include the following:
ALIGN=align-type | Specifies the horizontal alignment of text. |
align-type can be: | |
LEFT: | |
Text is placed flush to the left margin. This is the default value. | |
CENTER: | |
Text is placed center between the margins. | |
RIGHT: | |
Text is placed flush to the right margin. | |
CLASS=container-type | Specifies the type of container. |
container-type can be set to different kinds of containers, such as a chapter, section, abstract, or appendix. |
The DIV element is allowed within these elements:
A, ADDRESS, APPLET, B, BIG, BLOCKQUOTE, BR, CENTER, CITE, CODE, DFN, DIR, DIV, DL, EM, FONT, FORM, H1, H2, H3, H4, H5, H6, HR, I, IMG, INPUT, ISINDEX, KBD, LISTING, MAP, MENU, OL, P, PRE, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TABLE, TEXTAREA, TT, U, UL, VAR, and XMP
The element is allowed inside the following:
BLOCKQUOTE, BODY, CENTER, DD, DIV, FORM, LI, TD, and TH
<DIV>This is section ONE</DIV> <DIV>This is section TWO</DIV>
The DL element defines a definition list. A definition list is used to build two-column lists for terms and their corresponding definitions. The closing tag is required.
Syntax: | <DL><DT>...<DD>...</DL> |
Options include the following:
COMPACT | This setting suggests that items in the list are rendered in a compact way, by using a smaller font size or by reducing the vertical spacing between items in the list whenever possible. |
The DL element is allowed within these elements:
DD and DT
The element is allowed inside the following:
BLOCKQUOTE, BODY, CENTER, DD, DIV, FORM, LI, TD, and TH
<DL> <DT>Tree<DD>Vegetable <DT>Dog<DD>Animal <DT>Diamond<DD>Expensive mineral </DL>
The DT element specifies a term within a definition list (DL) element. The closing tag is optional.
Syntax: | <DT>...</DT> |
The DT element is allowed within these elements:
A, APPLET, B, BIG, BR, CITE, CODE, DFN, EM, FONT, I, IMG, INPUT, KBD, MAP, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TEXTAREA, TT, U, and VAR
The element is allowed inside the following:
DL
<DL> <DT>Tree<DD>Vegetable <DT>Dog<DD>Animal <DT>Diamond<DD>Expensive mineral </DL>
The EM is used for text that should be rendered with emphasis; usually it is rendered in italics. The EM element doesn't have any attributes.
Figure D.20. The EM element.
Syntax: | <EM>...</EM> |
The EM element is allowed within these elements:
A, APPLET, B, BIG, BR, CITE, CODE, DFN, EM, FONT, I, IMG, INPUT, KBD, MAP, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TEXTAREA, TT, U, and VAR
The element is allowed inside the following:
A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, DD, DFN, DIV, DT, EM, FONT, FORM, H1, H2, H3, H4, H5, H6, I, KBD, LI, P, PRE, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TD, TEXTFLOW, TH, TT, U, and VAR
<H1><EM>This title is emphasized, and should be shown italized</EM></H1> <EM>This text is emphasized, and should be shown italized</EM> <P> <STRONG><EM>This text is emphasized and strong, and should be shown italized and strong</EM></STRONG>
The EMBED element allows the insertion of arbitrary objects directly into an HTML page. Embedded objects obtain support via plug-ins and allow arbitrary attributes that plug-ins support. You should consider using the OBJECT element.
Syntax: | <EMBED HEIGHT=n NAME=name OPTIONAL PARAM="value" PALETTE="option" SRC=url WIDTH=n> |
Options for EMBED include the following:
HEIGHT=n | Sets the height of the object in pixels. |
NAME=name | Sets the name of the object. |
OPTIONAL PARAM=value | Sets parameters sent to the object. You can have as many of these as you need. |
PALETTE=foreground|background | Sets the color palette for the foreground and background. |
SRC=url | Sets the URL of any data to be inputted into the object. |
WIDTH=n | Specifies the width of the object in pixels. |
<EMBED WIDTH=300 HEIGHT=180 SRC="foo.wrl"> </EMBED>
The FONT element changes the font size and color.
Figure D.21. The FONT element.
Syntax: | <FONT COLOR=color FACE=name SIZE=n> |
Options for FONT include the following:
COLOR=color | Specifies the color of the font. Colors are specified in the HEX, 00-FF for each component of the RGB channel in the following format: #RRGGBB |
FACE=name | Sets the font. A list of comma-separated fonts can be provided. The system will search for the first available match. If none are available, the default font is used. |
SIZE=n | Specifies the size of the font. Font size ranges from 1-7 inclusive, with 7 being the largest. Prefixing n with a + or - sign specifies a relative font size based on the base font (usually set to 3). |
The FONT element is allowed within these elements:
A, APPLET, B, BIG, BR, CITE, CODE, DFN, EM, FONT, I, IMG, INPUT, KBD, MAP, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TEXTAREA, TT, U, and VAR
The element is allowed inside the following:
A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, DD, DFN, DIV, DT, EM, FONT, FORM, H1, H2, H3, H4, H5, H6, I, KBD, LI, P, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TD, TEXTFLOW, TH, TT, U, and VAR
<FONT SIZE=7 FACE="Helvetica" COLOR=RED> Helvetica Size +7, Red</FONT> <BR> <FONT SIZE=6 FACE="Times" COLOR=BLUE> Times Size +6, Blue </FONT> <BR> <FONT SIZE=5 FACE="Times"> Times Size +5</FONT> <BR> <FONT SIZE=4 FACE="Times"> Times Size +4</FONT> <BR> <FONT SIZE=3 FACE="Times"> Times Size +3</FONT> <BR> <FONT SIZE=2 FACE="Times"> Times Size +2</FONT> <BR> <FONT SIZE=1 FACE="Times"> Times Size +1</FONT>
The FORM element is used to create fill-out forms. The browser will permit the user to enter data into the fields provided and will send the entered data to the CGI program specified in the URL by the ACTION option. Closing tags are required.
Figure D.22. The FORM element.
Syntax: | <FORM ACTION=url ENCTYPE="application/x-www-form-urlencoded" METHOD=GET|POST TARGET=window>...</FORM> |
Options for FORM include the following:
ACTION | A URL that specifies the location to submit the contents. |
ENCTYPE | MIME-content type for encoding (application/x-www-form-urlencoded). |
METHOD | Specifies variations in the protocol to send form contents. |
GET | |
Information is passed via an environment variable. | |
POST | |
Information is passed via the programs stdin. | |
TARGET=window | Specifies that the target is loaded into the specified window. Possible values for window are |
window: Specifies to load the link into the named window. | |
blank: Creates the frame in a new unnamed window. | |
self: Loads the frame in the parent window. | |
parent: Loads in the parent window. | |
top: Loads in the top window. |
The FORM element is allowed within these elements:
A, ADDRESS, APPLET, B, BIG, BLOCKQUOTE, BR, CENTER, CITE, CODE, DFN, DIR, DIV, DL, EM, FONT, H1, H2, H3, H4, H5, H6, HR, I, IMG, INPUT, ISINDEX, KBD, LISTING, MAP, MENU, OL, P, PRE, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TABLE, TEXTAREA, TT, U, UL, VAR, and XMP
The element is allowed inside the following:
BLOCKQUOTE, BODY, CENTER, DD, DIV, LI, TD, and TH
<FORM ACTION="http://localhost/cgi-bin/printenv" METHOD="GET"> <INPUT TYPE="text" NAME="name" SIZE=30> <P> <INPUT TYPE=checkbox NAME=foo> Foo <BR> <INPUT TYPE="submit" VALUE="Submit"> </FORM> ...
The FRAME element defines a frame in a FRAMESET. The SRC attribute value is the URL of the document to be displayed inside the frame. If the SRC attribute is not specified, leave the frame blank.
Figure D.23. The FRAME element.
Syntax: | <FRAME ALIGN=align-type FRAMEBORDER=0|1 MARGINHEIGHT=n MARGINWIDTH=n NAME=name SCROLLING=YES|NO SRC=url> |
Options for FRAME include the following:
ALIGN=align-type | Specifies the alignment of the frame with respect to the surrounding text. Possible values are |
TOP: Places the top of the image at the text baseline. | |
MIDDLE: Centers the image on the text baseline. | |
BOTTOM: Places the bottom of the image at the text baseline. | |
LEFT: Image is aligned flush with the left margin. | |
RIGHT: Image is flush with the right margin. | |
FRAMEBORDER=0|1 | Draws a tridimensional border. If 1, the default draws it. If 0, it doesn't display a border. |
SCROLLING=YES|NO | This attribute specifies whether a scrollbar will be provided for the frame. This attribute accepts three values: YES, NO, or AUTO. AUTO is the default value. |
MARGINWIDTH=n | Horizontal margin size in pixels. |
MARGINHEIGHT=n | Vertical margin size in pixels. |
NAME=name | The name attribute specifies a name for using as the destination of a hyperlink (similar to the A element). Netscape has reserved the following values for NAME: |
blank: Creates the frame in a new unnamed window | |
self: Loads the frame in the parent window. | |
parent: Loads in the parent window. | |
top: Loads in the top window. | |
NORESIZE | NORESIZE prevents the user from resizing the frame. |
SRC=url | This specifies the URL for the document that will be displayed inside the frame. If this value is not defined, the frame is left blank. |
The FRAME element is allowed within these elements:
None. FRAME element is not a container.
The element is allowed inside the following:
FRAMESET
<FRAME SRC="frame2.html"> <FRAME SRC="frame3.html">
The FRAMESET element takes the place of the BODY element. It hosts the FRAME, FRAMESET, and NOFRAME elements. FRAMESET is used in HTML documents whose purpose is to define the layout of a FRAME-based documentone that includes additional HTML documents into specified areas of a window. FRAMESETs are specified as a list of comma-separated values.
Syntax: | <FRAMESET COLS=n FRAMEBORDER=1|0 FRAMESPACING=n ROWS=n> |
Options for FRAMESET include the following:
ROWS=n | Specifies the height of the FRAMESET. |
Values are specified as integers with optional subfix modifiers: | |
A % specifies a percentage of the window size. Legal values are between 1-100. | |
A * specifies a multiplier of the width height. | |
A plain number (no subfix) specifies the size in pixels. This is the default setting. | |
A single * with no number specifies whatever is left of the window. | |
COLS=n | Specifies the width of the FRAMESET. |
Values are specified as integers with optional subfix modifiers: | |
A % specifies a percentage of the window size. Legal values are between 1-100. | |
A * specifies a multiplier of the width height. | |
A plain number (no subfix) specifies the size in pixels. This is the default setting. | |
A single * with no number specifies whatever is left of the window. | |
FRAMEBORDER=0|1 | Draws a tridimensional border. If 1, the default draws it. If 0, displays no border. |
FRAMESPACING=n | Adds additional spacing (specified in pixels) between frames. |
<FRAMESET ROWS=100%> <NOFRAMES> <BODY> You don't have frames! </BODY> </NOFRAMES> <FRAMESET COLS=25%,75%> <FRAME SRC="frame1.html"> <FRAMESET ROWS=25%,75%> <FRAME SRC="frame2.html"> <FRAME SRC="frame3.html"> </FRAMESET> </FRAMESET> </FRAMESET>
The heading elements H1-H6 specify the size of a header in varying levels. The biggest header is H1, the smallest is H6, and all the others are in descending order between those two.
Figure D.24. H1 through H6 as rendered by Microsoft Internet Explorer.
Syntax: | <Hn>...</Hn> |
Options for Hn include the following:
n | Is the heading size. Possible values are 1-6 with 1 being the largest heading size. |
ALIGN=align-type | This attribute specifies the horizontal alignment of the header. Possible values are |
LEFT: Header is set flush with the left margin. | |
CENTER: Header is centered. | |
RIGHT: Header is set flush with the right margin. |
The Hn element is allowed within these elements:
A, APPLET, B, BIG, BR, CITE, CODE, DFN, EM, FONT, I, IMG, INPUT, KBD, MAP, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TEXTAREA, TT, U, and VAR
The element is allowed inside the following:
BLOCKQUOTE, BODY, CENTER, DD, DIV, LI, TD, and TH
<H1>Heading 1</H1> <H2>Heading 2</H2> <H3>Heading 3</H3> <H4>Heading 4</H4> <H5>Heading 5</H5> <H6>Heading 6</H6>
The HEAD element of an HTML document contains information about the document itself. None of the elements that legally belong on the HEADER section are displayed for the user. All displayed elements should appear in the BODY section. In addition to the following elements that are allowed within the HEAD, you can also use META tags. META tags provide additional information useful to indexing robots or to caching proxy servers.
The HEAD element is allowed within these elements:
BASE, ISINDEX, and TITLE
The element is allowed inside the following:
HTML
<HEAD> <TITLE="This is my document"> <META NAME="created" CONTENT="AUG, 12 Mon 1996 22:46:36 CST"> <META HTTP-EQUIV="Content-Language" CONTENT="en-us"> <META HTTP-EQUIV="Last-Modified" CONTENT="AUG, 12 Mon 1996 22:46:36 CST"> <BASE HREF="http://www.someaddress.com/ TARGET=_blank> </HEAD>
The HR element is used for drawing horizontal rules or lines. Horizontal rules can be used to visually divide sections.
Figure D.25. The HR element.
Syntax: | <HR ALIGN=align-type COLOR=color NOSHADE SIZE=n WIDTH=n> |
Options include the following:
ALIGN=align-type | Specifies alignment of the rule. Allowed values are |
LEFT: Rule is aligned to the left margin. | |
CENTER: Rule is centered. | |
RIGHT: Rule is aligned to the right margin. | |
COLOR=color | Specifies the color of the base font. Colors are specified using hexadecimal notation for each component in the RGB channel in the following format: #RRGGBB, or by specifying one of the Microsoft Internet Explorer predefined colors: Aqua, Black, Blue, Fuchsia, Gray, Green, Lime, Maroon, Navy, Olive, Purple, Red, Silver, Teal, Yellow, White. |
NOSHADE | Specifies that no shading should be used on the rule and that it should be displayed as a plain line. |
SIZE | The thickness of the rule in pixels. |
WIDTH | The width of a rule. Allowed values are |
number: width in pixels. | |
percentage (number%): Specifies width of the rule as a percentage of the width of the window. |
The HR element is allowed within these elements:
Not applicable.
The element is allowed inside the following:
BLOCKQUOTE, BODY, CENTER, DD, DIV, FORM, LI, TD, and TH
WIDTH=50%<HR WIDTH=50%> SIZE=15<HR SIZE=15> COLOR=red<HR COLOR="#FF0000"> No Shading<HR NOSHADE>
The HTML element encloses an entire HTML document; they are the outermost elements and should not be nested inside any other element. While their specification is not required, it is considered good practice to do it.
Syntax: | <HTML>...</HTML> |
The HTML element is allowed within these elements:
BODY and HEAD
The element is allowed inside the following:
Not applicable.
<HTML> <HEAD> <TITLE>This is HTML</TITLE> </HEAD> <BODY> <H1>This is HTML</H1> </BODY> </HTML>
The I element specifies that its contents are rendered in italics.
Figure D.26. The I element.
Syntax: | <I>...</I> |
The I element is allowed within these elements:
A, APPLET, B, BIG, BR, CITE, CODE, DFN, EM, FONT, I, IMG, INPUT, KBD, MAP, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TEXTAREA, TT, U, and VAR
The element is allowed inside the following:
A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, DD, DFN, DIV, DT, EM, FONT, FORM, H1...H6, I, KBD, LI, P, PRE, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TD, TEXTFLOW, TH, TT, U, and VAR
<H2>Here is a normal header</H2> <H2><I>Same header size, but italicized</I></H2> Here is some normal text<BR> <I>Here is some text with italics</I><BR>
The IMG element is used to insert inline graphics into an HTML document. The closing tag is optional.
Syntax: <IMG ALIGN=align-type ALT=text BORDER=n CONTROLS DYNSRC=url HEIGHT=n HSPACE=n ISMAP LOOP=n SRC=address START=start-event USEMAP=map-name VSPACE=n WIDTH=n>
Figure D.27. The IMG element.
Options include the following:
ALIGN=align-type | Specifies the vertical alignment of the image with respect to the text line, possible values are |
TOP: Places the top of the image at the text baseline. | |
MIDDLE: Centers the image on the text baseline. | |
BOTTOM: Places the bottom of the image at the text baseline. | |
LEFT: The image is aligned flush with the left margin and text flows around it. | |
RIGHT: The image is flush with the right margin and text flows around it. | |
ALT=text | Specifies a description that will be displayed on nongraphical browsers or when pictures are turned off. |
BORDER=n | Specifies a border to be displayed around the image in pixels if the image is a hyperlink. |
CONTROLS | If the image is a video clip, a set of controls is displayed under the clip. |
DYNSRC=url | (Dynamic Source); Specifies the address of the video clip or Virtual Reality Modeling Language (VRML) world. |
HEIGHT=n | Specifies the height of the image in pixels. This value together with the width allows the browser to layout the page more quickly because it can reserve space for the image beforehand. If you specify a different size than the actual size of the image, the image is scaled to fit into the specified dimension. |
HSPACE=n | Specifies a horizontal margin or gutter that gets added to the picture in pixels. The n amount is split between the left and right sides of the image. |
ISMAP | Is used to identify the image as a server-side image map. |
LOOP=n | Specifies how many times the video clip will loop when the page is activated. If set to INFINITE or -1, the clip will loop forever. |
SRC | Specifies the URI of the image to be inserted. |
START=start-event | Starts playing the file specified by DYNSRC. start-event can be one of the following: |
FILEOPEN: Starts playing as soon as the file is downloaded (default setting). | |
MOUSEOVER: Starts playing when the user moves the mouse over the animation. | |
USEMAP=map | Specifies that the image is a client-side image map and specifies that map should be used for defining the hotspots. Maps are defined using the MAP element. |
VSPACE | Specifies a vertical margin or gutter in pixels around the image. It's split between the top and bottom sides of the image. |
WIDTH | Specifies the width of the image in pixels. This value, together with the height, allows the browser to lay out the page more quickly because it can reserve space for the image beforehand. If you specify a different size than the actual size of the image, the image is scaled to fit into the specified dimension. |
The IMG element is allowed within these elements:
Not applicable.
The element is allowed inside the following:
A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, DD, DFN, DIV, DT, EM, FONT, FORM, H1...H6, I, KBD, LI, P, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TD, TEXTFLOW, TH, TT, U, and VAR
<A HREF="http://localhost"><IMG SRC="websiteby.gif" WIDTH=156 HEIGHT=39 ALT="WBAL" BORDER=15 ALIGN=TOP></A> BORDER=15 Aligned to the top of the image.<BR CLEAR=ALL> <P> <IMG SRC="websiteby.gif" WIDTH=156 HEIGHT=39 ALT="WBAL" VSPACE=10 ALIGN= MIDDLE> Vertical Spacing of 10, and aligned to the middle <BR CLEAR=ALL> <P> <IMG SRC="websiteby.gif" WIDTH=156 HSPACE=10 HEIGHT=39 ALT="WBAL" ALIGN=RIGHT> Right aligned. Additional space provided by HSPACE. Text flows around the image until it hits the BR CLEAR.<BR CLEAR=ALL> <P> <IMG SRC="websiteby.gif" WIDTH=312 HEIGHT=78 ALT="WBAL" ALIGN=BOTTOM> Doubled in size and bottom aligned!<BR CLEAR=ALL>
INPUT specifies a form control that the user can use to return values to a program on the server.
Figure D.28. The INPUT element.
Syntax: | <FORM ALIGN=align-type [CHECKED] MAXLENGTH=n NAME=name SIZE=n SRC=url TYPE=type VALUE=value> |
Options for INPUT include the following:
ALIGN=align-type | Used when the TYPE is set to image. It specifies how the following line of text will be aligned with the image. Valid alignment types are |
TOP: Text is aligned with the top of the image. | |
MIDDLE: Text is aligned with the center of the image. | |
BOTTOM: Text is aligned with the bottom of the image. | |
CHECKED | Sets a check box or radio control to selected setting when the form is initially loaded. |
MAXLENGTH=n | Specifies the maximum number of characters that the input field will accept. |
NAME=name | Sets the name of the control. |
SIZE=size | Specifies the size of the control in characters. |
SRC=url | Specifies the URL for an image type control. |
TYPE=type | Specifies the type of control to use. It can be any of the following: |
CHECKBOX: A simple control that allows ON or OFF relationships. The default setting is set to YES. | |
HIDDEN: The input field is hidden from the user; however, the contents of the field are returned to the server. Hidden fields can be used for passing values between your CGI and the browser without having them displayed in the browser window. | |
IMAGE: Sets the input field to be a graphic that when clicked submits the form. The coordinates where the user clicked are returned to the server with the upper-left corner of the image being the origin. Coordinates are returned as two values matching the name of the field with the coordinate designator ".x" or ".y" appended to it. | |
PASSWORD: Specifies a text field where the user can enter a password or other information that should not be echoed back in the form. | |
RADIO: A radio button allows the user to select one of several options. Each radio button part of a group should be named the same. Only the selected button will return a value, which should be explicitly set using the VALUE option. | |
RESET: A button that when activated will reset the contents of the form to their default settings. You can specify a different name for the RESET button using the VALUE option. | |
SUBMIT: A button that when activated will submit the contents of the form. You can rename the button with the VALUE option. If the NAME option is set, the SUBMIT button will contribute the value set in NAME to the submitted data. | |
TEXT: A single line text entry field. This is the default control type. | |
VALUE=value | Sets the default value for text or numerical controls. |
The INPUT element is allowed within these elements:
Not applicable.
The element is allowed inside the following:
A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, DD, DFN, DIV, DT, EM, FONT, FORM, H1, H2, H3, H4, H5, H6, I, KBD, LI, P, PRE, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TD, TEXTFLOW, TH, TT, U, and VAR
<FORM ACTION="http://www.accesslink.com/cgi-bin/envvar" METHOD="GET"> Name: <INPUT TYPE="text" NAME="name" SIZE=40> Password: <INPUT TYPE="password" NAME="passwd" SIZE=30> <HR> Food: <INPUT TYPE=radio NAME="food" VALUE="chicken"> Chicken <INPUT TYPE=radio NAME="food" VALUE="fish"> Fish <INPUT TYPE=radio NAME="food" VALUE="beef"> Beef <INPUT TYPE=radio NAME="food" VALUE="vegies"> Vegan <HR> Equipment Compatibility:<BR> <INPUT TYPE=checkbox NAME=equip VALUE="cd-rom">CD-ROM <INPUT TYPE=checkbox NAME=equip VALUE="audio">Audio <INPUT TYPE=checkbox NAME=equip VALUE="networking">Ethernet <INPUT TYPE=checkbox NAME=equip VALUE="battery">DC <HR> Pick Your Ride:<BR> <SELECT NAME="car" MULTIPLE> <OPTION SELECTED VALUE="pacer"> Pacer <OPTION VALUE="ferrari"> Ferrari <OPTION VALUE="small convertible"> Small Vintage British Sports Cars <OPTION VALUE="luxurious german sendan"> Mercedes Benz </SELECT> <P> <INPUT TYPE="submit" VALUE="Deliver my Toys!"> </FORM>
The ISINDEX element is a precursor of the FORM element. It informs the browser that the document is searchable. This element automatically generates an input field for the user.
Figure D.29. The ISINDEX element.
Syntax: | <ISINDEX ACTION=url PROMPT=prompt> |
Options include the following:
ACTION=url | Specifies the URL of the CGI program that will handle the entered information. |
PROMPT=prompt | Specifies the text placed next to the input field. The default message is You can search this index. Type the keyword(s) you want to search for:. |
The ISINDEX element is allowed within these elements:
Not applicable.
The element is allowed inside the following:
BLOCKQUOTE, BODY, CENTER, DD, DIV, FORM, HEAD, LI, TD, and TH
<ISINDEX ACTION="http://www.somesite.com/seach" PROMPT="Enter a product name here.">
The KBD element renders text to represent text that the user should enter at the keyboard. Generally this is represented using a monospaced bold font. Close tags for this element are required.
Figure D.30. The KBD element.
Syntax: | <KBD>...</KBD> |
The KBD element is allowed within these elements:
A, APPLET, B, BIG, BR, CITE, CODE, DFN, EM, FONT, I, IMG, INPUT, KBD, MAP, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TEXTAREA, TT, U, and VAR
The element is allowed inside the following:
A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, DD, DFN, DIV, DT, EM, FONT, FORM, H1-H6, I, KBD, LI, P, PRE, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TD, TEXTFLOW, TH, TT, U, and VAR
<KBD> gcc -Wall -o run *.o </KBD> <P> After that, type the following: <P> <KBD> run file1 file2 file3 </KBD>
The LI element is used to specify an element in a list under a DIR, MENU, OL, or UL element. The closing tag is optional and seldom used.
Figure D.31. The LI element as rendered by Microsoft Explorer.
Figure D.32. The LI element as rendered by Navigator.
Syntax: | <LI TYPE=order-type VALUE=n>...</LI> |
Options include the following:
TYPE=order-type | Specifies the type of bullet to be used in the list. Valid values are |
DISK: A standard solid bullet. | |
SQUARE: Square bullets | |
CIRCLE: Unfilled circles | |
1: Bullets with numbers | |
a: Bullets with lowercase letters | |
A: Bullets with uppercase letters | |
i: Bullets with small Roman numerals | |
I: Bullets with large Roman numerals | |
VALUE=n | Specifies the number for the first item on the list. It is specified as a number and converted as needed. |
The LI element is allowed within these elements:
A, APPLET, B, BIG, BLOCKQUOTE, BR, CENTER, CITE, CODE, DFN, DIR, DIV, DL, EM, FONT, FORM, HR, I, IMG, INPUT, ISINDEX, KBD, LISTING, MAP, MENU, OL, P, PRE, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TABLE, TEXTAREA, TT, U, UL, VAR, and XMP
The element is allowed inside the following:
DIR, MENU, OL, and UL
Here is an unordered list: <UL> <LI>Red <LI>Blue <LI>Green </UL> Here is an unordered list with different bullet types (Netscape only): <UL> <LI TYPE=DISK>Red <LI TYPE=SQUARE>Blue <LI TYPE=CIRCLE>Green </UL> Here is an ordered list: <OL COMPACT> <LI>Red <LI>Blue <LI>Green </OL>
The LINK element is used to define a relationship between the current document and another object or document. Multiple LINK relationships can exist in a single document. This element is not widely used, and many browsers don't support it yet. However, it provides useful information because it relates documents to authoritative sources responsible for the contents. You may use more than one LINK elements.
Syntax: | <LINK HREF=URL ID=ID REL=rel REV=rev TITLE=cdata> |
Options include the following:
HREF | The URL of the object being linked to. |
ID | The SGML ID attribute. |
REL | Defines a relationship where the target recognizes, authorizes, or verifies. (Not usually implemented.) |
REV | Defines a relationship where the source desires and expects a claimed relationship. However, this relationship needs to be verified with the target. (Not usually implemented.) |
TITLE | Used to label a link, perhaps with the title of the document. |
The LINK element is allowed within these elements:
The LINK element is an empty container. As such it doesn't have any content.
The element is allowed inside the following:
HEAD
<LINK HREF="http://www.someplace.com/products.html">
The LISTING element renders text literally. It does not reinterpret whitespace so multiline entries are rendered as they are in the source text with the same line breaks and multiple spaces. LISTING is usually rendered in a monospaced font. The LISTING element was a precursor to the PRE element. This element is available for backward compatibility purposes. Open and close tags are required.
Figure D.33. The LISTING element.
Syntax: | <LISTING>...</LISTING> |
The LISTING element is allowed within these elements:
Not applicable.
The element is allowed inside the following:
BLOCKQUOTE, BODY, CENTER, DD, DIV, FORM, LI, TD, and TH
Try the following program: <P> <LISTING> #include <stdio.h> int main() { printf( "Hello World!\n" ); return 0; } </LISTING>
The MAP element is used to define a client-side image map. A client-side image map specifies a set of regions on an image that can be used as hyperlinks by clicking on them. The advantage of client-side image maps is that they take map processing loads from the server, as well as activate additional visual cues on the user's browser regarding "hot spots" in the images. The closing tag is required.
Syntax: | <MAP NAME="#name">...</MAP> |
Options include the following:
NAME | Specifies the NAME used to reference the map in the IMG attribute USEMAP option. Note the pound sign (#) before the name. |
The MAP element is allowed within this element:
AREA
The element is allowed inside the following:
A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, DD, DFN, DIV, DT, EM, FONT, FORM, H1, H2, H3, H4, H5, H6, I, KBD, LI, P, PRE, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TD, TEXTFLOW, TH, TT, U, and VAR
Note that USEMAP option requires a # sign (just like a local HREF) before the name of the fragment containing the map coordinates. An example is as follows:
<MAP NAME=map> <AREA SHAPE=RECT COORDS="56,7,106,86" HREF="#b" ALT=b> <AREA SHAPE=CIRCLE COORDS="219,63,23" HREF="#e" ALT=e> </MAP> <IMG SRC=letters.GIF ALT=letters USEMAP=#map> <A NAME=b> <P> You clicked on B!</A> <A NAME=e> <P> You clicked on E!</A>
The MARQUEE element defines an area where scrolling text will be displayed. This is a Microsoft Internet Explorer 2.0 extension. The MARQUEE element provides many options to control the behavior of the MARQUEE and provides an interesting way of adding text animation without increasing download requirements.
Figure D.34. The MARQUEE element.
Syntax: | <MARQUEE ALIGN=align-type BEHAVIOR=type BGCOLOR=color DIRECTION=direction HEIGHT=n HSPACE=n LOOP=n SCROLLAMOUNT=n SCROLLDELAY=n VSPACE=n WIDTH=n> </MARQUEE> |
Options include the following:
ALIGN=align-type | Specifies the alignment of the text surrounding the marquee. Legal values for align-type are |
TOP: Aligns the surrounding text with the top of the marquee. | |
MIDDLE: Aligns the surrounding text with the middle of the marquee. | |
BOTTOM: Aligns the surrounding text with the bottom of the marquee. | |
BEHAVIOR=type | Specifies how the text scrolls. Type can be one of the following values: |
SCROLL: Scrolls text starting on one side and disappearing on the other, reappears again on the starting side. | |
SLIDE: Starts on one side and stops scrolling as soon as the text touches the opposite margin. | |
ALTERNATE: Bounces back and forth between margins. | |
BGCOLOR=color | Specifies the background color of the document. Colors are specified in the HEX, 00-FF for each component of the RGB channel in the #RRGGBB format. or by specifying one of the Microsoft Internet Explorer predefined colors: Aqua, Black, Blue, Fuchsia, Gray, Green, Lime, Maroon, Navy, Olive, Purple, Red, Silver, Teal, Yellow, White. |
DIRECTION=direction | DIRECTION specifies the direction of travel that the text will follow. Possible values are LEFT or RIGHT. The default value is LEFT (text starts scrolling from the right). |
HEIGHT=n | Specifies the height of the marquee. HEIGHT can be specified as pixels or as a percentage of the screen size when suffixed with a % character. |
HSPACE=n | Specifies the horizontal gutter to separate surrounding elements from the marquee. |
LOOP=n | Specifies the number of iterations that the marquee will loop. A setting of -1 or INFINITE will loop the text while the page remains on the screen. |
SCROLLAMOUNT=n | Specifies the number of pixels the text will scroll at a time. |
SCROLLDELAY=n | Specifies the number of milliseconds between successive draws of the marquee. |
VSPACE=n | Specifies the vertical gutter that separates surrounding elements from the marquee. |
WIDTH=n | Specifies the width of the marquee. HEIGHT can be specified as pixels or as a percentage of the screen size when suffixed with a % character. |
The MARQUEE element is allowed within these elements:
A, B, BGSOUND, BR, CITE, CODE, DFN, EM, ENTITY, FONT, I, IMG, KBD, MAP, MARQUEE, NOBR, SAMP, STRIKE, STRONG, TT, U, VAR, and WBR
The element is allowed inside the following:
A, ADDRESS, B, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, COMMENT, DD, DFN, DT, EM, ENTITY, FONT, FORM, H1-H6, I, KBD, LI, MARQUEE, P, SAMP, STRIKE, STRONG, TD, TH, TT, U, and VAR
<MARQUEE ALIGN=MIDDLE BEHAVIOR=ALTERNATE> This is an alternating banner </MARQUEE> <MARQUEE ALIGN=MIDDLE BEHAVIOR=ALTERNATE BGCOLOR="#FFFFFF" HEIGHT=30 DIRECTION=LEFT> This is also an alternating banner, but with HEIGHT=30, and a white background. </MARQUEE> <MARQUEE ALIGN=MIDDLE BEHAVIOR=SCROLL WIDTH=50%> This is a scrolling banner, WIDTH=50% </MARQUEE> <MARQUEE ALIGN=MIDDLE BEHAVIOR=SLIDE WIDTH=50%> This is a sliding banner, WIDTH=50% </MARQUEE>
The MENU element defines an list of items. Each entry is started with a LI element.
Figure D.35. The MENU element.
Syntax: | <MENU>...</MENU> |
Options include the following:
COMPACT | Specifies the items that should be rendered in a compact form, usually by reducing the vertical space between list items. |
The MENU element is allowed within this element:
LI
The element is allowed inside the following:
BLOCKQUOTE, BODY, CENTER, DD, DIV, FORM, LI, TD, and TH
<MENU> <LI>Steak <LI>Eggs <LI>Chicken <LI>Liver <LI>Fish <LI>Donut </MENU>
The META element provides information about the HTML document to browsers and programs such as search engines or caching proxy servers. META information is placed in the HEAD section of a document.
Syntax: | <META HTTP-EQUIV=response CONTENT=description NAME=description URL=url> |
The options available for META include the following:
CONTENT=description | Sets the description to be associated with the given NAME or HTTP-EQUIV response header. It can be used with a URL= and a date/time specification to reload a document at a specified interval. |
HTTP-EQUIV=response | Binds the META element to the HTTP response header. The server will include response as fields in the header information. |
NAME=description | A description. |
URL=url | The document's URL. |
The META element is allowed within this element:
HEAD
The element is allowed inside the following:
Not applicable because it is not a container element.
A typical use of the META element is to embed expiration date dates for documents. This will avoid any caching of a document past the specified date. In addition, you can use META tags to insert reply-to information (an e-mail address for the person responsible for the document). An interesting use is to specify an auto-refresh setting that will force the browser to reload the contents of the document every so often or to load an entirely different document, as with a client-pull. Another frequent use is to imbed keywords that indexing robots will use to classify your document. Here are some examples (they can all coexist in the same document):
<META HTTP-EQUIV="Expires" CONTENT="Aug, 11 Mar 1996 12:00:00 -0600"> <META HTTP-EQUIV="Reply-to" CONTENT="info@yourcompany.com"> <META HTTP-EQUIV="REFRESH" CONTENT="10" URL="http://www.yourcompany.com/timeIsUp.html"> <META NAME="keywords" CONTENT="This document describes the META tag which you can only view for 10 seconds">
The NOBR element turns off line breaking. The browser won't wrap text when the window is resized. This is originally a Netscape 1.x extension. Microsoft Internet Explorer supports this feature since version 3.0.
Figure D.36. The NOBR element.
Syntax: <NOBR>...</NOBR>
The NOBR element is allowed within these elements:
A, B, BLOCKQUOTE, BR, CITE, CODE, DIR, DL, EM, FORM, I, IMG, ISINDEX, KBD, LISTING, MENU, OL, P, PRE, SAMP, STRONG, TT, UL, VAR, and XMP
The element is allowed inside the following:
A, ADDRESS, B, BLOCKQUOTE, BODY, CITE, CODE, DD, DT, EM, FORM, H1-H6, I, KBD, LI, P, PRE, SAMP, STRONG, TT, and VAR
<NOBR>This is a very long line of text that I don't it to be broken.</NOBR> <BR> If you shorten your browser window, you'll see that while this line wraps the one above doesn't
The NOFRAMES element contains HTML that gets displayed to browsers that don't have support for frames. By using the NOFRAMES element, you can create an entry page that is compatible with all browsers because you can present two different entrances to your frame content. Frame-aware browsers ignore this element.
This was originally a Netscape 2.0 extension that has since been adopted by Microsoft Internet Explorer 3.0.
Figure D.37. The browser renders the content of the NOFRAMES element.
The NOFRAMES element is allowed within these elements:
A, ADDRESS, APPLET, B, BIG, BLINK, BLOCKQUOTE, BR, CENTER, CITE, CODE, DFN, DIR, DIV, DL, EM, FONT, FORM, H1, H2, H3, H4, H5, H6, HR, I, IMG, INPUT, ISINDEX, KBD, LISTING, MAP, MENU, OL, P, PRE, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TABLE, TEXTAREA, TT, U, UL, VAR, and XMP
The element is allowed inside the following:
FRAMESET
<NOFRAMES> <BODY> <H1>You don't have frames!</H1> You should provide alternative HTML here to access the site. </BODY> </NOFRAMES>
The OBJECT element inserts an object such as an image, document, applet, or control into an HTML document. It is intended to be a more general and flexible mechanism for handling multimedia elements.
Syntax: | <OBJECT ALIGN=align-type BORDER=n CLASSID=url CODEBASE=url CODTYPE=codetype DATA=url DECLARE HEIGHT=n HSPACE=n NAME=url SHAPES STANDBY=message TYPE=type USEMAP=utl VSPACE=n WIDTH=n> </OBJECT> |
Options include the following:
ALIGN=align-type | Specifies the alignment for the object: |
BASELINE: The bottom of the object aligns to the baseline of the surrounding text. | |
CENTER: The object is centered between the margins. Text following the object is placed on the next line. | |
LEFT: The object is left-margin aligned. Text wraps along the right edge of the object. | |
MIDDLE: The middle of the object is aligned with the baseline of the surrounding text. | |
RIGHT: The object is right-margin aligned. Text wraps along the left side of the object. | |
TEXTBOTTOM: The bottom of the object aligns with the bottom of the text. | |
TEXTMIDDLE: The middle of the object aligns with the middle of the text. | |
TEXTTOP: The top of the object aligns with the top of the text. | |
BORDER=n | Specifies the width of the border displayed for objects that are hyperlinks. |
CLASSID=url | Identifies the object implementation. The syntax for the URL depends on the object type. |
CODEBASE=url | Identifies the codebase for the object. Syntax is object dependent. |
CODETYPE=codetype | Specifies the Internet media type for code. |
DATA=url | Specifies the source for the data. Syntax is object dependent. |
DECLARE | Declares the object without creating it. Useful if you are creating a cross-reference or using the object as a parameter. |
HEIGHT=n | Specifies the height of the object. |
HSPACE=n | Specifies the horizontal gutter for the object. |
NAME=url | Sets the name of the object when submitted as part of a form. |
SHAPES | Specifies that the object has hyperlinks, as in a client-side image map for the object. |
STANDBY=message | Sets the message that is displayed while the object is loaded. |
TYPE=type | Specifies the Internet media type for the data. |
USEMAP=utl | Specifies the image map to use with the object. |
VSPACE=n | Specifies the vertical gutter. |
WIDTH=n | Specifies the width of the object. |
The element is allowed inside the following:
All elements that are legal inside a BODY element.
A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, DD, DFN, DIV, DT, EM, FONT, FORM, H1...H6, I, KBD, LI, P, PRE, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TD, TEXTFLOW, TH, TT, U, and VAR
The OL element specifies an ordered list. An ordered list consists of a number of LI elements that are ordered numerically in some way. OL elements need to be properly closed.
Figure D.38. The OL element.
Syntax: | <OL COMPACT START=n TYPE=order-type> </OL> |
Options include the following:
COMPACT | Specifies that the list should be rendered in compact form, perhaps by reducing the leading between entries. |
START=n | Specifies the starting number for the list. Representation of this number will vary depending on the TYPE specified. |
TYPE=order-type | TYPE specifies the numbering style for the list. Legal values include the following: |
A: Use uppercase letters. | |
a: Use lowercase letters. | |
I: Use large Roman numerals. | |
i: Use small Roman numerals. | |
1: Use numbers. |
The OL element is allowed within this element:
LI
The element is allowed inside the following:
BLOCKQUOTE, BODY, CENTER, DD, DIV, FORM, LI, TD, and TH
This example shows the use of the OL element. Note that it is very flexible in terms of what you need to do to start renumbering in the right spot.
<H1>Automatic Lists are Great!</H1> <OL> <LI> This is the first item <LI> This is the second <OL TYPE=a> <LI>Alphabetical listing (restarted numbering) <LI>This is another entry <LI>Yet another </OL> <LI>This is another item </OL> <B> This is another section, start renumbering where we left </B><BR> <I>Some wordprocessors I use have trouble doing this</I> <OL START=4> <LI> This is the first item (started where we left-off) <LI> This is the second <OL TYPE=a> <LI>Alphabetical listing <LI>This is another entry <LI>Yet another </OL> <LI>This is another item </OL>
The OPTION element specifies one choice in a SELECT element, which in turn is part of the contents of a FORM element.
Syntax: | <OPTION SELECTED VALUE=value> |
Options include the following:
SELECTED | Designates the default item. If the item doesn't exit, then the first element becomes the default. |
VALUE | Specifies the value that will be returned to the server if this were chosen. |
The OPTION element is allowed within these elements:
Not applicable. Element is not a container.
The element is allowed inside the following:
SELECT
<INPUT TYPE=radio NAME="food" SELECTED VALUE="chicken"> Chicken
The P element inserts a paragraph break and separates two blocks of text. Paragraph elements do not nest, so starting a new paragraph automatically implies closing the previous one. Many elements imply a text separation, such as headings, list elements, and blockquotes. A closing paragraph tag is not required, but is considered good style
Figure D.39. The P element.
Syntax: | <P ALIGN=align-type>...</P> |
Options include the following:
ALIGN | The ALIGN options are Netscape extensions. Microsoft Internet Explorer supports them, too. ALIGN sets the alignment for the paragraph. Possible alignment types are LEFT, CENTER, and RIGHT. The default setting is LEFT. |
The P element is allowed within these elements:
A, APPLET, B, BIG, BR, CITE, CODE, DFN, EM, FONT, I, IMG, INPUT, KBD, MAP, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TEXTAREA, TT, U, and VAR
The element is allowed inside the following:
ADDRESS, BLOCKQUOTE, BODY, CENTER, DD, DIV, FORM, LI, TD, and TH
<P>This is a plain paragraph. It uses the default LEFT alignment.</P> <P ALIGN=CENTER>This next paragraph aligns to the center of the window.</P> <P ALIGN=RIGHT>This last paragraph aligns to the right of the window.</P>
The PARAM element is used to pass values to a given object, such as a Java applet.
Syntax: | <PARAM NAME=name VALUE=value VALUETYPE=type TYPE=type> |
Options include the following:
NAME=name | Identifies the name of the parameter or key that VALUE will set. |
VALUE=value | Specifies the value passed to the object. |
VALUETYPE=type | On Microsoft Internet Explorer only, it specifies how to interpret the value. The type can be any of the following: |
DATA: The value is data. This is the default value type. | |
REF: The value is an URL. | |
OBJECT: The value is an URL of an object in the same document. | |
Type=type | On Microsoft Internet Explorer only, it specifies the MIME-type of the object. |
The PARAM element is allowed within these elements:
Not applicable. Element is not a container.
The element is allowed inside the following:
APPLET, (Microsoft Internet Explorer only: OBJECT)
<applet codebase="../LED" code="LED.class" width=500 height=48 align=center> <param name="script" value="../scripts/Demo.led"> <param name="border" value="2"> <param name="bordercolor" value="100,130,130"> <param name="spacewidth" value="3"> <param name="wth" value="122"> <param name="ht" value="9"> <param name="font" value="../fonts/default.font"> <param name="ledsize" value="3"> </applet>
The PLAINTEXT element renders text in a fixed font without processing elements until a closing PLAINTEXT tag is found. Text is rendered with a monospaced font.
Figure D.40. The PLAINTEXT element.
Syntax: <PLAINTEXT>...</PLAINTEXT>
The PLAINTEXT element is allowed within these elements:
Not applicable. Element disables HTML parsing.
The element is allowed inside the following:
Not applicable. Element disables HTML parsing.
<PLAINTEXT> <P>This is a plain paragraph. It uses the default LEFT alignment.</P> <P ALIGN=CENTER>This paragraph is center aligned.</P> <P ALIGN=RIGHT>This paragraph is right aligned</P> </PLAINTEXT>
The PRE element renders text in a fixed font. It is useful for displaying ASCII art or any other type of formatting that relies on the spacing of the characters.
Figure D.41. The PRE element.
Syntax: | <PRE WIDTH=n>...</PRE> |
Options include the following:
WIDTH | The browser will try to render at least n characters. |
The PRE element is allowed within these elements:
A, APPLET, B, BR, CITE, CODE, DFN, EM, I, INPUT, KBD, MAP, SAMP, SCRIPT, SELECT, STRIKE, STRONG, TEXTAREA, TT, U, and VAR
The element is allowed inside the following:
BLOCKQUOTE, BODY, CENTER, DD, DIV, FORM, LI, TD, and TH
<!DOCTYPE html PUBLIC "-//Netscape Comm. Corp.//DTD HTML//EN"> <HTML> <HEAD> <TITLE>PRE Sample</TITLE> </HEAD> <BODY> <B>Formatting maintained with the aid of the PRE element</B> <PRE> Jul Aug Sep S M Tu W Th F S S M Tu W Th F S S M Tu W Th F S 1 2 3 4 5 6 1 2 3 1 2 3 4 5 6 7 7 8 9 10 11 12 13 4 5 6 7 8 9 10 8 9 10 11 12 13 14 14 15 16 17 18 19 20 11 12 13 14 15 16 17 15 16 17 18 19 20 21 21 22 23 24 25 26 27 18 19 20 21 22 23 24 22 23 24 25 26 27 28 28 29 30 31 25 26 27 28 29 30 31 29 30 </PRE> <B>No PRE element</B><BR> Jul Aug Sep S M Tu W Th F S S M Tu W Th F S S M Tu W Th F S<BR> 1 2 3 4 5 6 1 2 3 1 2 3 4 5 6 7<BR> 7 8 9 10 11 12 13 4 5 6 7 8 9 10 8 9 10 11 12 13 14<BR> 14 15 16 17 18 19 20 11 12 13 14 15 16 17 15 16 17 18 19 20 21<BR> 21 22 23 24 25 26 27 18 19 20 21 22 23 24 22 23 24 25 26 27 28<BR> 28 29 30 31 25 26 27 28 29 30 31 29 30<BR> </BODY> </HTML>
The S element renders text in strikethrough type.
Figure D.42. The S element.
Syntax: | <S>...</S> |
The S element is allowed within these elements:
A, APPLET, B, BIG, BR, CITE, CODE, DFN, EM, FONT, I, IMG, INPUT, KBD, MAP, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TEXTAREA, TT, U, and VAR
The element is allowed inside the following:
A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, DD, DFN, DIV, DT, EM, FONT, FORM, H1, H2, H3, H4, H5, H6, I, KBD, LI, P, PRE, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TD, TEXTFLOW, TH, TT, U, and VAR
Use strikethrough to indicate a <S>corections</S> corrections or revisions
The SAMP element renders its context as sample text.
Figure D.43. The SAMP element.
Syntax: | <SAMP>...<SAMP> |
The SAMP element is allowed within these elements:
A, APPLET, B, BIG, BR, CITE, CODE, DFN, EM, FONT, I, IMG, INPUT, KBD, MAP, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TEXTAREA, TT, U, and VAR
The element is allowed inside the following:
A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, DD, DFN, DIV, DT, EM, FONT, FORM, H1, H2, H3, H4, H5, H6, I, KBD, LI, P, PRE, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TD, TEXTFLOW, TH, TT, U, and VAR
<P> <SAMP> You are called to the scene of an unusual accident. It seems that a semi-truck has become stuck under a railroad trestle and simply can't be moved. Tow trucks have tried both pushing and pulling it out, but to no avail. Taking the trestle out to free the truck is being considered and officials are considering getting a heavy duty crane to remove it. You, being clever, however, come up with a suggestion, and within 10 minutes, the truck is free and on its way. </SAMP> <P> What suggestion did you make?
The SCRIPT element denotes the inclusion of a script that a script-enabled browser can execute. Scripts execute and instatiate objects in the order in which they appear in the HTML document.
Options include the following:
LANGUAGE=scripting-language | The language used for the script. Valid options are |
VBScript: For Visual Basic Scripts | |
JavaScript: For JavaScripts |
The SCRIPT element is allowed within these elements:
Not applicable.
The element is allowed inside the following:
A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, DD, DFN, DIV, DT, EM, FONT, FORM, H1, H2, H3, H4, H5, H6, HEAD, I, KBD, LI, P, PRE, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TD, TEXTFLOW, TH, TT, U, and VAR
<SCRIPT LANGUAGE="JavaScript"> </SCRIPT>
The SELECT element creates a single or multiple choice MENU.
Syntax: | <SELECT MULTIPLE NAME=name SIZE=n>...</SELECT> |
Options include the following:
MULTIPLE | Enables multiple item selection. |
NAME=name | Specifies the name of the list. |
SIZE=n | Specifies the height of the list control. |
The SELECT element is allowed within this element:
OPTION
The element is allowed inside the following:
A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, DD, DFN, IV, DT, EM, FONT, FORM, H1, H2, H3, H4, H5, H6, I, KBD, LI, P, PRE, SAMP, SMALL, TRIKE, STRONG, SUB, SUP, TD, TEXTFLOW, TH, TT, U, and VAR
Pick Your Ride:<BR> <SELECT NAME="car" MULTIPLE> <OPTION SELECTED VALUE="pacer"> Pacer <OPTION VALUE="ferrari"> Ferrari <OPTION VALUE="small convertible"> Small Vintage British Sports Cars <OPTION VALUE="luxurious german sendan"> Mercedes Benz </SELECT>
The SMALL element
renders its contents one size smaller, if appropriate.
Figure D.44. The SMALL element.
Syntax: <SMALL>...</SMALL>
The SMALL element is allowed within these elements:
A, APPLET, B, BIG, BR, CITE, CODE, DFN, EM, FONT, I, IMG, INPUT, KBD, MAP, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TEXTAREA, TT, U, and VAR
The element is allowed inside the following:
A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, DD, DFN, DIV, DT, EM, FONT, FORM, H1, H2, H3, H4, H5, H6, I, KBD, LI, P, PRE, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TD, TEXTFLOW, TH, TT, U, and VAR
<P>This is normal text <P> <SMALL>This is one size smaller</SMALL>
The STRIKE element renders text in strikethrough type. This element produces similar results to the previously mentioned S element.
Figure D.45. The STRIKE element.
Syntax: | <STRIKE>...</STRIKE> |
The STRIKE element is allowed within these elements:
A, APPLET, B, BIG, BR, CITE, CODE, DFN, EM, FONT, I, IMG, INPUT, KBD, MAP, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TEXTAREA, TT, U, and VAR
The element is allowed inside the following:
A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, DD, DFN, DIV, DT, EM, FONT, FORM, H1, H2, H3, H4, H5, H6, I, KBD, LI, P, PRE, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TD, TEXTFLOW, TH, TT, U, and VAR
Use strike to indicate a <STRIKE>corections</STRIKE> corrections or revisions
The STRONG element emphasizes text, which is usually rendered in boldface. Its use may be more desirable than the B element for backwards compatibility.
Figure D.46. The STRONG element.
Syntax: | <STRONG>...</STRONG> |
The STRONG element is allowed within these elements:
A, APPLET, B, BIG, BR, CITE, CODE, DFN, EM, FONT, I, IMG, INPUT, KBD, MAP, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TEXTAREA, TT, U, and VAR
The element is allowed inside the following:
A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, DD, DFN, DIV, DT, EM, FONT, FORM, H1, H2, H3, H4, H5, H6, I, KBD, LI, P, PRE, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TD, TEXTFLOW, TH, TT, U, and VAR
<P>This word is <STRONG>strong</STRONG>! <P>This word is <STRONG><EM>strong and emphasized</EM></STRONG>!
The SUB element renders text as subscript.
Figure D.47. The SUB element.
Syntax: | <SUB>...</SUB> |
The SUB element is allowed within these elements:
A, APPLET, B, BIG, BR, CITE, CODE, DFN, EM, FONT, I, IMG, INPUT, KBD, MAP, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TEXTAREA, TT, U, and VAR
The element is allowed inside the following:
A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, DD, DFN, DIV, DT, EM, FONT, FORM, H1, H2, H3, H4, H5, H6, I, KBD, LI, P, PRE, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TD, TEXTFLOW, TH, TT, U, and VAR
<P>Drink lots of H<SUB>2</SUB>O! <P>Do not drink concentrated H<SUB>2</SUB>SO<SUB>4</SUB>!
The SUP element renders text as superscript.
Figure D.48. The SUP element.
Syntax: | <SUP>...</SUP> |
The SUP element is allowed within these elements:
A, APPLET, B, BIG, BR, CITE, CODE, DFN, EM, FONT, I, IMG, INPUT, KBD, MAP, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TEXTAREA, TT, U, and VAR
The element is allowed inside the following:
A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, DD, DFN, DIV, DT, EM, FONT, FORM, H1, H2, H3, H4, H5, H6, I, KBD, LI, P, PRE, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TD, TEXTFLOW, TH, TT, U, and VAR
E = mc<SUP>2</SUP>
The TABLE element creates an empty table to which you can add rows and cells using the TR, TD, and TH elements.
Figure D.49. The TABLE element.
Figure D.50. Another TABLE example. Note that table cells can have different attributes under Microsoft Internet Explorer.
Syntax: | <TABLE ALIGN=align-type BACKGROUND=url BGCOLOR=color BORDER=n BORDERCOLOR=color BORDERCOLORDARK=color BORDERCOLORLIGHT=color CELLPADDING=n CELLSPACING=n COLS=n FRAME=frame-type RULES=rules WIDTH=n>...</TABLE> |
Options include the following:
ALIGN=align-type | Specifies the alignment of the contents of the table. Align type can be |
LEFT: The table contents align to the left edge of the table. This is the default setting. | |
CENTER: The table contents are aligned to the center edge of the table. | |
RIGHT: The table contents align to the right edge of the table. | |
BACKGROUND=url | Specifies a background picture to be tiled in the table background. |
BGCOLOR=color | Specifies the background color of the document. Colors are specified in the HEX, 00-FF for each component of the RGB channel in the #RRGGBB format, or by specifying one of the Microsoft Internet Explorer predefined colors: Aqua, Black, Blue, Fuchsia, Gray, Green, Lime, Maroon, Navy, Olive, Purple, Red, Silver, Teal, Yellow, or White. |
BORDER=n | Specifies the size, in pixels, of the table border. The default is zero. |
BORDERCOLOR=color | Specifies the border color of the table. Colors are specified in the HEX, 00-FF for each component of the RGB channel in the #RRGGBB format. |
BORDERCOLORDARK=color | Specifies the dark color used for drawing tridimensional table borders. Colors are specified in the HEX, 00-FF for each component of the RGB channel in the #RRGGBB format. |
BORDERCOLORLIGHT=color | Specifies the light color used for drawing tridimensional table borders. Colors are specified in the HEX, 00-FF for each component of the RGB channel in the #RRGGBB format. |
CELLPADDING=n | Specifies the amount of space in pixels between the sides of a cell and its contents. |
CELLSPACING=n | Specifies the amount of space in pixels between cells. |
COLS=n | Specifies the number of columns in a table. This option can speed up the rendering of complex tables because the browser doesn't need to calculate various settings. |
FRAME=frame-type | Specifies which sides of the frame are displayed. Possible values include |
VOID: Removes all borders. | |
ABOVE: Displays a border on the top side of the table frame. | |
BELOW: Displays a border on the bottom side of the table frame. | |
HSIDES: Displays a border on the horizontal sides, that is top and bottom sides of the table frame. | |
LHS: Displays a border on the left side of the table frame. | |
RHS: Displays a border on the right side of the table frame | |
VSIDES: Displays a border on the vertical sides of the table frame, which is the left and right table frames. | |
BOX: Displays a border on all sides of the table frame. | |
BORDER: Displays a border on all sides of the table frame. | |
RULES=rules | Specifies the inner lines of the table frame. Possible values are |
NONE: Doesn't display interior table lines. | |
GROUPS: Displays horizontal lines between all table sections or groups, such as the head, body, foot, and column groups (by use of the THEAD, TBODY, TFOOT, and COLGROUP elements, respectively). | |
ROWS: Displays horizontal lines between all table rows. | |
COLS: Displays vertical lines between table columns. | |
ALL: Displays all lines. | |
WIDTH=n | Sets the width of the table in pixels, or as a percentage of the window if n is specified with the % suffix. |
The TABLE element is allowed within these elements:
CAPTION and TR
The element is allowed inside the following:
BLOCKQUOTE, BODY, CENTER, DD, DIV, FORM, LI, TD, and TH
<TABLE BORDER=1 ALIGN=LEFT> <TR> <TH>Name<TH>Age<TH>Phone </TR> <TR> <TD>Joe Blow<TD>27<TH>272-2920 </TR> <TR> <TD>John Doe<TD COLSPAN=2 ALIGN=CENTER>UNKNOWN </TR> </TABLE> This table has one cell with a COLSPAN of 2. It also is bordered by a BORDER=1 setting. This text is wrapping along the side due to the ALIGN=LEFT attribute in the TABLE element. <BR CLEAR=ALL> <P> <TABLE BORDER=3 ALIGN=RIGHT > <TR> <TH>Name<TH>Age<TH>Phone </TR> <TR> <TD>Joe Blow<TD>27<TH>272-2920 </TR> <TR> <TD>John Doe<TD COLSPAN=2 ALIGN=CENTER>UNKNOWN </TR> </TABLE> This table is much like the table above, except for the fact that it has a thicker BORDER (3) and table is aligned to the right rather than to the left.
TBODY defines the body of the table in contrast to the header or footer. The TBODY element is optional if the table doesn't have a header and a footer. A table can have multiple TBODY elements. The closing tag is optional.
Syntax: | <TBODY>...</TBODY> |
The TBODY element is allowed within this element:
TABLE
The element is allowed inside the following:
TR, TH, and TD
<TABLE> <THEAD> <TR> </TR> <TBODY> <TR> </TR> </TBODY> </TABLE>
The TD element is used to define a table data cell.
Syntax: | <TD ALIGN=align-type BACKGROUND=url BGCOLOR=color BORDERCOLOR=color BORDERCOLORDARK=color BORDERCOLORLIGHT=color COLSPAN=n NOWRAP=NOWRAP ROWSPAN=n VALIGN=align-type> </TD> |
Options include the following:
ALIGN=align-type | Specifies the alignment of the contents of the cell, align-type can be one of the following: |
LEFT: The contents are left aligned. | |
CENTER: The contents are centered. | |
RIGHT: The contents are right aligned. | |
BACKGROUND=url | Specifies a background picture to be tiled in the cell background. |
BGCOLOR=color | Specifies the background color of the document. Colors are specified in the HEX, 00-FF for each component of the RGB channel in the #RRGGBB format. or by specifying one of the Microsoft Internet Explorer predefined colors: Aqua, Black, Blue, Fuchsia, Gray, Green, Lime, Maroon, Navy, Olive, Purple, Red, Silver, Teal, Yellow, White. |
BORDERCOLOR=color | Specifies the border color of the cell. Colors are specified in the HEX, 00-FF for each component of the RGB channel in the #RRGGBB format. |
BORDERCOLORDARK=color | Specifies the dark color used for drawing tridimensional cell borders. Colors are specified in the HEX, 00-FF for each component of the RGB channel in the #RRGGBB format. |
BORDERCOLORLIGHT=color | Specifies the light color used for drawing tridimensional cell borders. Colors are specified in the HEX, 00-FF for each component of the RGB channel in the #RRGGBB format. |
VALIGN=align-type | Specifies the vertical alignment of the objects inside the cell. Align-type can be one of the following values: |
TOP: Text is aligned with the top of the cell. | |
MIDDLE: Text is centered vertically with the middle of the cell. This is the default setting. | |
BOTTOM: Text is aligned with the cell's bottom. | |
BASELINE: Text in neighboring cells is aligned along a common baseline. |
The TD element is allowed within these elements:
A, ADDRESS, APPLET, B, BIG, BLOCKQUOTE, BR, CENTER, CITE, CODE, DFN, DIR, DIV, DL, EM, FONT, FORM, H1...H6, HR, I, IMG, INPUT, ISINDEX, KBD, LISTING, MAP, MENU, OL, P, PRE, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TABLE, TEXTAREA, TT, U, UL, VAR, and XMP
The element is allowed inside the following:
TR
<TR> <TD>John Doe<TD COLSPAN=2 ALIGN=CENTER>UNKNOWN </TR>
The TEXTAREA creates a multiline text entry widget that can be used to enter and edit multiple lines of text.
Figure D.51. The TEXTAREA element.
Syntax: | <TEXTAREA COLS=n NAME=name ROWS=n> |
Options include the following:
COLS=n | Sets the width of the text area in characters. |
NAME=name | Sets the name of the text area. name is used to map the contents of the widget to a variable that is submitted when the form is sent. |
ROWS=n | Sets the height of the text area in lines of text. |
The TEXTAREA element is allowed within these elements:
Not applicable. The TEXTAREA element is not a container element.
The element is allowed inside the following:
A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, DD, DFN, DIV, DT, EM, FONT, FORM, H1...H6, I, KBD, LI, P, PRE, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TD, TEXTFLOW, TH, TT, U, and VAR
<TEXTAREA COLS=80 ROWS=10 NAME=textarea></TEXTAREA>
The TFOOT element defines a table footer. This element is optional and is used to distinguish possible rows in the head and body of a table. Closing tag is optional.
Syntax: | <TFOOT>...</TFOOT> |
The TFOOT element is allowed within this element:
TR
The element is allowed inside the following:
TABLE
<TABLE> <THEAD> <TR> </TR> <TBODY> <TR> </TR> </TBODY> <TFOOT> <TR> </TR> </TFOOT> </TABLE>
The TH element creates a row or column heading in a table. Elements in the table head are emphasized because they label the columns.
Syntax: | <TD ALIGN=align-type BACKGROUND=url BGCOLOR=color BORDERCOLOR=color BORDERCOLORDARK=color BORDERCOLORLIGHT=color COLSPAN=n NOWRAP=NOWRAP ROWSPAN=n VALIGN=align-type>...</TD> |
The following are options for TH:
ALIGN=align-type | Specifies the alignment of the contents of the cell. align-type can be one of the following: |
LEFT: The contents are left aligned. | |
CENTER: The contents are centered. | |
RIGHT: The contents are right aligned. | |
BACKGROUND=url | Specifies a background picture to be tiled in the cell background. |
BGCOLOR= | Specifies the background color of the document. Colors are specified in the HEX, 00-FF for each component of the RGB channel in the #RRGGBB format, or by specifying one of the Microsoft Internet Explorer predefined colors: Aqua, Black, Blue, Fuchsia, Gray, Green, Lime, Maroon, Navy, Olive, Purple, Red, Silver, Teal, Yellow, or White. |
BORDERCOLOR=color | Specifies the border color of the cell. Colors are specified in the HEX, 00-FF for each component of the RGB channel in the #RRGGBB format. |
BORDERCOLORDARK=color | Specifies the dark color used for drawing tridimensional cell borders. Colors are specified in the HEX, 00-FF for each component of the RGB channel in the #RRGGBB format. |
BORDERCOLORLIGHT=color | Specifies the light color used for drawing tridimensional cell borders. Colors are specified in the HEX, 00-FF for each component of the RGB channel in the #RRGGBB format. |
VALIGN=align-type | Specifies the vertical alignment of the objects inside the cell. align-type can be one of the following values: |
TOP: Text is aligned with the top of the cell. | |
MIDDLE: Text is centered vertically with the middle of the cell. This is the default setting. | |
BOTTOM: Text is aligned with the cell's bottom. | |
BASELINE: Text in neighboring cells is aligned along a common baseline. |
The TH element is allowed within these elements:
A, ADDRESS, APPLET, B, BIG, BLOCKQUOTE, BR, CENTER, CITE, CODE, DFN, DIR, DIV, DL, EM, FONT, FORM, H1...H6, HR, I, IMG, INPUT, ISINDEX, KBD, LISTING, MAP, MENU, OL, P, PRE, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TABLE, TEXTAREA, TT, U, UL, VAR, and XMP
The element is allowed inside the following:
TR
<TABLE BORDER=3 ALIGN=RIGHT > <TR> <TH>Name<TH>Age<TH>Phone </TR> </TABLE>
The THEAD element defines a table header. This element is optional and only one is allowed per table. Its purpose is to give control of the rendering of the rows from those in the table body and table footer.
Syntax: | <THEAD>...</THEAD> |
The THEAD element is allowed within this element:
TR
The element is allowed inside the following:
TABLE
<TABLE> <THEAD> <TR> </TR> <TBODY> <TR> </TR> </TBODY> <TFOOT> <TR> </TR> </TFOOT> </TABLE>
The TITLE element specifies the title of the document. The title specified is usually displayed as the window title. This element is only valid within the HEAD element. A closing tag is required.
Syntax: | <TITLE>...</TITLE> |
The TITLE element is allowed within these elements
Not applicable.
The element is allowed inside the following:
HEAD
<TITLE>This is the title of my document</TITLE>
The TR element creates a row inside a table. The closing tag is optional.
Syntax: | <TR ALIGN=align-type BACKGROUND=url BGCOLOR=color BORDERCOLOR=color BORDERCOLORDARK=color BORDERCOLORLIGHT=color VALIGN=align-type> </TR> |
Options include the following:
ALIGN=align-type | Specifies the alignment of the contents of the cell, align-type can include one of the following: |
LEFT: The contents are left aligned. | |
CENTER: The contents are centered. | |
RIGHT: The contents are right aligned. | |
BACKGROUND=url | Specifies a background picture to be tiled in the cell background. |
BGCOLOR=color | Specifies the background color of the document. Colors are specified in the HEX, 00-FF for each component of the RGB channel in the #RRGGBB format, or by specifying one of the Microsoft Internet Explorer predefined colors: Aqua, Black, Blue, Fuchsia, Gray, Green, Lime, Maroon, Navy, Olive, Purple, Red, Silver, Teal, Yellow, White. |
BORDERCOLOR=color | Specifies the border color of the cell. Colors are specified in the HEX, 00-FF for each component of the RGB channel in the #RRGGBB format. |
BORDERCOLORDARK=color | Specifies the dark color used for drawing tridimensional cell borders. Colors are specified in the HEX, 00-FF for each component of the RGB channel in the #RRGGBB format. |
BORDERCOLORLIGHT=color | Specifies the light color used for drawing tridimensional cell borders. Colors are specified in the HEX, 00-FF for each component of the RGB channel in the #RRGGBB format. |
VALIGN=align-type | Specifies the vertical alignment of the objects inside the cell. align-type can be one of the following values: |
TOP: Text is aligned with the top of the cell. | |
MIDDLE: Text is centered vertically with the middle of the cell. This is the default setting. | |
BOTTOM: Text is aligned with the cell's bottom. | |
BASELINE: Text in neighboring cells is aligned along a common baseline. |
The TR element is allowed within these elements
TD and TH
The element is allowed inside the following:
TABLE
<TABLE> <TR> </TR> </TABLE>
The TT element specifies that text should be rendered in a monospace font to simulate output from a teletype.
Figure D.52. The TT (teletype) element.
Syntax: | <TT>...</TT> |
The TT element is allowed within these elements:
A, APPLET, B, BIG, BR, CITE, CODE, DFN, EM, FONT, I, IMG, INPUT, KBD, MAP, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TEXTAREA, TT, U, and VAR
The element is allowed inside the following:
A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, DD, DFN, DIV, DT, EM, FONT, FORM, H1...H6, I, KBD, LI, P, PRE, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TD, TEXTFLOW, TH, TT, U, and VAR
... <TT> Here is some text rendered in a teletype (TT) style </TT> ...
The U element renders emphasis on the text by underlining it.
Figure D.53. The U element.
Syntax: | <U>...</U> |
The U element is allowed within these elements:
A, APPLET, B, BIG, BR, CITE, CODE, DFN, EM, FONT, I, IMG, INPUT, KBD, MAP, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TEXTAREA, TT, U, and VAR
The element is allowed inside the following:
A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, DD, DFN, DIV, DT, EM, FONT, FORM, H1, H2, H3, H4, H5, H6, I, KBD, LI, P, PRE, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TD, TEXTFLOW, TH, TT, U, and VAR
<U> Here is some underlined text. </U>
The UL element renders lines of text as a bulleted list. Each element in the list is denoted by a LI element. Open and closing tags are required.
Syntax: | <UL COMPACT TYPE=bullet-type>...</UL> |
Options include the following:
COMPACT | This setting suggests that items in the list are rendered in a compact way, by using a smaller font size or by reducing the vertical spacing between items in the list whenever possible. |
TYPE=bullet-type | Specifies the type of bullet to render. Possible options include |
DISK: Renders a standard solid bullet. | |
SQUARE: Renders a square bullet. | |
CIRCLE: Renders a nonsolid solid bullet. |
The UL element is allowed within this element:
LI
The element is allowed inside the following:
BLOCKQUOTE, BODY, CENTER, DD, DIV, FORM, LI, TD, and TH
The VAR element renders the enclosed text as a variable. Text is displayed in a small monospaced font. Open and close tags are required.
Figure D.54. The VAR element.
The VAR element is allowed within these elements:
A, APPLET, B, BIG, BR, CITE, CODE, DFN, EM, FONT, I, IMG, INPUT, KBD, MAP, SAMP, SCRIPT, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TEXTAREA, TT, U, and VAR
The element is allowed inside the following:
A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, DD, DFN, DIV, DT, EM, FONT, FORM, H1, H2, H3, H4, H5, H6, I, KBD, LI, P, PRE, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TD, TEXTFLOW, TH, TT, U, and VAR
In Einstein's general law of relativity, <VAR>E</VAR> is energy, <VAR>m</VAR> is mass, and <VAR>c</VAR> is the speed of light.
>A HREF="s eleme.gif"<Syntax: <WBR>
The WBR element is allowed within these elements:
Not applicable. Element is not a container.
The element is allowed inside the following:
NOBR
<NOBR>
<P>This is a very long line of text that I want to break here, <WBR> because I want this line unbroken! </NOBR>
The XMP element renders text it encloses as an example. Usually, the text is rendered in a monospaced font.
Figure D.55. The XMP element.
Syntax: | <XMP>...</XMP> |
The XMP element is allowed within these elements:
Not applicable.
The element is allowed inside the following:
BLOCKQUOTE, BODY, CENTER, DD, DIV, FORM, LI, TD, and TH
<HTML> <HEAD> <TITLE>XMP (Example)</TITLE> </HEAD> <BODY> <H1>XMP <EM>(Example)</EM></H1> <HR> What is the answer to this problem: <P> <XMP> What is the square root of -1? </XMP> <P> What did you suggest? </BODY> </HTML>