Appendix HA Review of HTML
Before you can use JavaScript in a Web page, you need to know how to write a Web page. This appendix reviews the basic HTML you need to know to put together Web pages. It also reviews the structure of a good Web page. The basic structure of a Web pageWeb pages are composed of HTML tags, content, and comments. The content-the plain text of the page-should be contained within HTML tags. Most browsers will display content that is not contained within HTML tags, but HTML standards don't require them to display uncontained content. The content, not the tags, should contain comments, if for no better reason than that it makes the page more readable and easier to maintain. Comments begin with <!-- and end with -->. It's a good practice never to place a double dash (--) or a right angle bracket (>) within a comment. Some browsers may prematurely terminate the comment when they read these character sequences. It's important to remember this when writing JavaScript code, which you usually place inside comments to keep JavaScript-ignorant browsers from displaying the code on the screen. HTML tags are special keywords enclosed within angle brackets (< and >). They may have attributes that refine the behavior of the tag; attributes are typically of the form name=value. When a tag has attributes, some of them are mandatory and the others are optional. Certain browsers may let you get away with omitting mandatory attributes, but you shouldn't expect all browsers to do so. The attribute values may be numeric or text, and may be enclosed within quotes. Some tools you can use to verify the syntax of your pages have trouble with attribute values; enclosing the values within quotes usually helps. Tag and attribute names are case-insensitive. Attribute values are almost always case-sensitive. Because most content is lowercase (uppercase text is perceived as shouting), I prefer to write tag and attribute names in uppercase. It makes them stand out from the content. Most tags have corresponding end tags. The end tag contains the same keyword as the first tag, or start tag, but with a leading slash (/) character. Like the start tag, it is enclosed within angle brackets. Unlike start tags, end tags do not have attributes. Some tags contain text, and these tags have end tags. In certain specialized circumstances, the end tag is implied; for example, within a table row, a table cell that starts with a <TD> tag is implicitly ended by another <TD> tag. It is a good practice, however, always to use end tags. It makes your code easier to read and maintain. An HTML element consists of either a tag that contains no text, such as an <IMG> tag, or a tag and its end tag and the text between them, such as
In the first case, the element is called an empty element. In the second case, the element is called a container element. Certain rules dictate which HTML elements can exist within which other HTML elements. You can nest HTML elements, but their start and end tags cannot overlap. For example, you may wish to render text in a bold italic font. You can do so by enclosing the text within <B> and </B>, and within <I> and </I>. <B><I>text</I></B> will work. <I><B>text</B></I> will work. <B><I>text</B></I> will not work. Some tags have attributes in common with each other. These common attributes take common values, and these values may not be very obvious as to what they do. Uniform Resource Locators, colors, the ALIGN attribute, and the CLEAR attribute are not well understood. Uniform Resource LocatorsUniform Resource Locators, or URLs, specify the location of documents on the Internet, and the protocol that is used to retrieve them. The general format of a URL is protocol hostname port pathname search hash These are defined as follows:
An absolute URL has a protocol, host name, and path name, and may include a port, search, and hash field. A relative URL has no protocol or host name, and the path name is not usually a full path name. ColorsTags that take color attributes may specify the color values in two different ways: by name or by hex triplet. There are 140 defined color names, such as red, black, and turquoise. Hex triplets consist of a pound sign followed by the hexadecimal values of the red component, the green component, and the blue component. Each component may have a value from 00 to FF, and must have two digits. AlignmentSome elements can float freely within a stream of text, and have ALIGN attributes that permit you to dictate where the element will appear on the screen. The most common values for the ALIGN attribute are left, right, top, texttop, middle, absmiddle, baseline, bottom, and absbottom. Left and right alignment (ALIGN="left" and ALIGN="right") place a free-floating element below the current line of text, on either the left margin or the right margin. Text flows around the element. Top and texttop alignment (ALIGN="top" and ALIGN="texttop") place a free-floating element on the screen so that the top of the element is lined up with the top of the line up to that point. In other words, alignment is with respect to text and elements to the left of the current element. The difference between top and texttop alignment is that top alignment takes text and elements into account, and texttop alignment only considers text. Middle and absmiddle alignment (ALIGN="middle" and ALIGN="absmiddle") place a free-floating element on the screen so that the middle of the element is lined up with either the baseline of the text (ALIGN="middle") or with the middle of the text and elements to the left (ALIGN="absmiddle"). When there is nothing but text to the left, there is almost no difference between the two. Baseline, bottom, and absbottom alignment (ALIGN="baseline", ALIGN="bottom", and ALIGN="absbottom") place a free-floating element on the screen so that the bottom of the element is lined up either with the baseline of the text (ALIGN="baseline" and ALIGN="bottom"-they are synonymous) or with the bottom of the lowest text or element to the left of the free-floating element (ALIGN="absbottom"). ClearCLEAR is a common attribute used by elements. This attribute specifies that the browser should go farther down the screen until the specified margin is clear before displaying the element's text. Typical values are left, right, and all (both left and right margins must be clear). In Figures 1 through 4, a BR (line break) element, which can take a CLEAR attribute, is inserted into the text following the word "break." In Figure 1, with CLEAR="left", the text stops until the image on the left is cleared, and then resumes. In Figure 2, with CLEAR="right", the text stops until the image on the right is cleared, and then resumes. In Figure 3, with CLEAR="all", the text stops until both images are cleared, and then resumes. Finally, in Figure 4, there is no CLEAR attribute and text resumes on the next line, between the two images. Figure 1 : <BR CLEAR="left"> Figure 2 : <BR CLEAR="right"> Netscape-supported HTML elementsThis section includes short descriptions of the HTML elements currently supported by Netscape. These elements do not pertain solely to JavaScript. Each element description mentions commonly used attributes of the element, explains the function of the element, includes special notes about the element, and tells what elements may be contained within that element. Figure 3 : <BR CLEAR="all"> Figure 4 : <BR> with no CLEAR attribute The A element marks the beginning of a hypertext link if it uses the HREF attribute or the destination of a hypertext link if it uses the NAME attribute. In JavaScript, it's a link object if it uses the HREF attribute and an anchor object if it contains the NAME attribute. There are five attributes, but an A element must have an HREF or NAME attribute. Both can be used in the same element-an A element may be both a link object and an anchor object.
The A element is a container element that can contain content text and B, BASEFONT, BIG, BLINK, BR, CITE, CODE, EM, FONT, H1, H2, H3, H4, H5, H6, I, IMG, KBD, NOBR, SAMP, SMALL, STRIKE, SUB, SUP, TT, VAR, and WBR elements. It may not contain another A element. Its contents are usually highlighted by the browser when the HREF attribute is used. ADDRESSThe ADDRESS element indicates that its contents constitute an address. Typical usage would include electronic signatures and lists of authors. This element has no attributes, and it is a container element that may contain content text and A, B, BASEFONT, BIG, BLINK, BR, CITE, CODE, EM, FONT, I, IMG, KBD, NOBR, P, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TT, VAR, and WBR elements. APPLETThe APPLET element loads a Java applet and executes it. It has eight attributes:
The APPLET element is a container element that may contain content text and A, B, BASEFONT, BIG, BLINK, BR, CITE, CODE, EM, FONT, I, IMG, KBD, NOBR, PARAM, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, VAR, and WBR elements. AREAThe AREA element defines a region within a MAP element that the user may select. If the HREF attribute is used, the area acts like the beginning of a hypertext link. If the NOHREF attribute is used, the area acts like a "dead zone"; if the user clicks in such an area, nothing happens. There can be multiple AREA elements within a MAP element. In case of overlap, the first AREA element that contains the coordinates the user selected will be the active element. The coordinates start in the image's upper-left corner. There are four attributes:
The AREA element is an empty element. B (Boldface)The B element specifies that the browser should render the contents in a bold font. There are no attributes. The B element is a container element that may contain content text and A, B, BASEFONT, BIG, BLINK, BR, CITE, CODE, EM, FONT, I, IMG, KBD, NOBR, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TT, VAR, and WBR elements. BASEThe BASE element overrides the Web page's URL as the base for relative URLs. It has one mandatory attribute, HREF=string, where the value specifies the base for relative URLs. The BASE element is empty. BASEFONTThe BASEFONT element overrides the value of the base font size (which by default is 3). The browser adds relative FONT element values to the base font size. The BASEFONT element has one mandatory attribute, SIZE=number, where the number value is the base font size. The BASEFONT element is a container element that may contain content text and A, ADDRESS, APPLET, B, BASEFONT, BIG, BLINK, BLOCKQUOTE, BR, CENTER, CITE, CODE, DIR, DIV, DL, EM, FONT, FORM, H1, H2, H3, H4, H5, H6, HR, I, IMG, KBD, MAP, MENU, NOBR, OL, P, PRE, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TABLE, TT, UL, VAR, and WBR elements. BIGThe BIG element specifies that the browser should render the contents in a larger than normal font. There are no attributes. The BIG element is a container element that may contain content text and A, B, BASEFONT, BIG, BLINK, BR, CITE, CODE, EM, FONT, I, IMG, KBD, NOBR, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TT, VAR, and WBR elements. BLINKThe BLINK element requests that contained elements be rendered in a blinking font. The blinking effect is as alarming as a shout of "Fire!" Just as most of us don't have a reason to pull the fire alarm every day, there is hardly ever a good reason to include blinking text in an ordinary document. Use of BLINK is considered even more vulgar than writing text in all uppercase. There are no attributes. The BLINK element is a container element that may contain content text and A, B, BASEFONT, BIG, BLINK, BR, CITE, CODE, EM, FONT, I, IMG, KBD, NOBR, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TT, VAR, and WBR elements. BLOCKQUOTEThe BLOCKQUOTE element indicates that its contents constitute a quotation. The BLOCKQUOTE element has no attributes. It is a container element that may contain content text and A, ADDRESS, APPLET, B, BASEFONT, BIG, BLINK, BLOCKQUOTE, BR, CENTER, CITE, CODE, DIR, DIV, DL, EM, FONT, FORM, H1, H2, H3, H4, H5, H6, HR, I, IMG, KBD, MAP, MENU, NOBR, OL, P, PRE, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TABLE, TT, UL, VAR, and WBR elements. BODYThe BODY element contains the visible contents of the document. The BODY element has eight optional attributes:
The BODY element is a container element that may contain content text and A, ADDRESS, APPLET, B, BASEFONT, BIG, BLINK, BLOCKQUOTE, BR, CENTER, CITE, CODE, DIR, DIV, DL, EM, FONT, FORM, H1, H2, H3, H4, H5, H6, HR, I, IMG, KBD, MAP, MENU, NOBR, OL, P, PRE, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TABLE, TT, UL, VAR, and WBR elements. BR (Line Break)The BR element forces a line break. It has one optional attribute, CLEAR=string, where the value indicates how far down the browser should space until the indicated margin is clear of text and images. Valid values include left, right, and all. The BR element is an empty element. CAPTIONThe CAPTION element defines a table caption. It has two attributes:
The CAPTION element is a container element that may contain content text and A, B, BASEFONT, BIG, BLINK, BR, CITE, CODE, EM, FONT, I, IMG, KBD, NOBR, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TT, VAR, and WBR elements. CENTERThe CENTER element indicates that the browser should horizontally center the contained text. It has no attributes. The CENTER element is a container element that may contain content text and A, ADDRESS, APPLET, B, BASEFONT, BIG, BLINK, BLOCKQUOTE, BR, CENTER, CITE, CODE, DIR, DIV, DL, EM, FONT, FORM, H1, H2, H3, H4, H5, H6, HR, I, IMG, KBD, MAP, MENU, NOBR, OL, P, PRE, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TABLE, TT, UL, VAR, and WBR elements. CITEThe CITE element indicates that the contained text is a citation. There are no attributes. The CITE element is a container element that may contain content text and A, B, BASEFONT, BIG, BLINK, BR, CITE, CODE, EM, FONT, I, IMG, KBD, NOBR, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TT, VAR, and WBR elements. CODEThe CODE element indicates that the contained text is computer code and should be rendered in a suitable font. This element is recommended for short, single-line text; the PRE element is the element of choice for longer text, especially multiline text. There are no attributes. The CODE element is a container element that may contain content text and A, B, BASEFONT, BIG, BLINK, BR, CITE, CODE, EM, FONT, I, IMG, KBD, NOBR, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TT, VAR, and WBR elements. DD (Definition Description)The DD element contains the definition portion of a definition list item. It has no attributes, and is a container element that may contain content text and A, APPLET, B, BASEFONT, BIG, BLINK, BLOCKQUOTE, BR, CENTER, CITE, CODE, DIR, DL, EM, FONT, FORM, I, IMG, KBD, MENU, NOBR, OL, P, PRE, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TABLE, TT, UL, VAR, and WBR elements. DIR (Directory)The DIR element creates a list of short text items, such as file names. It has no attributes, and is a container element that may contain LI elements and their contents. A DIR element cannot contain APPLET, BLOCKQUOTE, CENTER, DIR, DL, FORM, MENU, OL, P, PRE, TABLE, or UL elements. DIV (Division)The DIV element breaks a document into major subdivisions. It has five attributes:
The DIV element is a container element that may contain content text and A, ADDRESS, APPLET, B, BASEFONT, BIG, BLINK, BLOCKQUOTE, BR, CENTER, CITE, CODE, DIR, DIV, DL, EM, FONT, FORM, H1, H2, H3, H4, H5, H6, HR, I, IMG, KBD, MAP, MENU, NOBR, OL, P, PRE, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TABLE, TT, UL, VAR, and WBR elements. DL (Definition List)The DL element contains a list of definitions. It has one attribute, COMPACT, which suggests that the list be rendered in a more compact form. The DL element is a container element that may contain DD and DT elements. DT (Definition Term)The DT element contains a term in a list of definitions. It has no attributes, and is a container element that may contain content text and A, B, BASEFONT, BIG, BLINK, BR, CITE, CODE, EM, FONT, I, IMG, KBD, NOBR, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TT, VAR, and WBR elements. EM (Emphasis)The EM element indicates that the browser should emphasize the contents. Browsers typically render the contents in an italic font. There are no attributes. The EM element is a container element that may contain content text and A, B, BASEFONT, BIG, BLINK, BR, CITE, CODE, EM, FONT, I, IMG, KBD, NOBR, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TT, VAR, and WBR elements. FONTThe FONT element defines the font size for contained text. The size may be absolute or relative; the browser adds the base font value to relative font sizes. This element has two attributes:
The FONT element is a container element that may contain content text and A, B, BASEFONT, BIG, BLINK, BR, CITE, CODE, EM, FONT, I, IMG, KBD, NOBR, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TT, VAR, and WBR elements. FORMThe FORM element defines a block of input fields that the user may fill in. The browser usually sends the user's data to a CGI application on the server. If the GET method is used, the CGI application can access an environment variable with the name QUERY_STRING. If the POST method is used, the CGI application can read the data from the standard input stream (stdin); the environment variable CONTENT_LENGTH contains the length of the data. Data is sent as name=value pairs separated by ampersands (&). The name=value pairs are URL-encoded-spaces are converted to pluses (+) and some characters are converted to a percent (%) character followed by the character's two-digit hexadecimal value. The FORM element has six attributes:
A FORM element is a container element that may contain content text and A, ADDRESS, APPLET, B, BASEFONT, BIG, BLINK, BLOCKQUOTE, BR, CENTER, CITE, CODE, DIR, DIV, DL, EM, FONT, H1, H2, H3, H4, H5, H6, HR, I, IMG, INPUT, KBD, MAP, MENU, NOBR, OL, P, PRE, SAMP, SELECT, SMALL, STRIKE, STRONG, SUB, SUP, TABLE, TEXTAREA, TT, UL, VAR, and WBR elements. A FORM element may not contain another FORM element. A FORM element must contain at least one INPUT, SELECT, or TEXTAREA element. FRAMEThe FRAME element defines a frame, which is a subsection of the browser screen. It has six attributes:
The FRAME element is an empty element. FRAMESETThe FRAMESET element defines a set of frames and how the containing window or frame will be divided to hold them. A FRAMESET element has four attributes:
A FRAMESET element must have either a COLS or a ROWS attribute, but not both. The COLS and ROW attribute values consist of frame widths or heights separated by commas. There should be no spaces in the value, and there should be one frame width or height for each FRAME or FRAMESET contained in the FRAMESET element. Frame widths and heights may be numbers, percentages (number followed by a percent sign), or relative values (an asterisk preceded by an optional number). Values that are numbers specify the height or width of the corresponding FRAME or FRAMESET element in pixels. Percentage values specify the percentage of the available space that should be allocated to the corresponding FRAME or FRAMESET element. Relative valued elements are allocated after all number and percentage valued elements have been allocated. If there are no relative values and the percentage values do not add up to 100 percent, the browser will adjust the percentage values to add up to 100 percent. A FRAMESET element is a container element that may contain FRAME, NOFRAME, and FRAMESET elements. H1, H2, H3, H4, H5, and H6 (Headings)The H1, H2, H3, H4, H5, and H6 elements create headings. The most prominent is H1 and the least prominent is H6. These elements have three attributes:
Heading elements are container elements that may contain content text and A, B, BASEFONT, BIG, BLINK, BR, CITE, CODE, EM, FONT, I, IMG, KBD, NOBR, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TT, VAR, and WBR elements. HEADThe HEAD element contains information about the document. It has no attributes and is a container element that may contain BASE, ISINDEX, LINK, META, NEXTID, SCRIPT, and TITLE elements. A TITLE element is considered mandatory by HTML specifications, but if the document is intended solely as a frame within a larger document, the TITLE element will be ignored and is not necessary. The NEXTID element is used only by automated hypertext editors, and its use is not recommended. HR (Horizontal Rule)The HR element draws a horizontal line across the page. There are four attributes:
The HR element is an empty element. HTMLThe HTML element contains the entire document. It has no attributes, and it should contain a HEAD element followed by a BODY or FRAMESET element. In your JavaScript code, either or both elements may be superfluous. I (Italic)The I element specifies that the browser should render the contents in an italic font. There are no attributes. The I element is a container element that may contain content text and A, B, BASEFONT, BIG, BLINK, BR, CITE, CODE, EM, FONT, I, IMG, KBD, NOBR, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TT, VAR, and WBR elements. IMG (Image)The IMG element embeds an inline image in the document. The image may be used as an image map-an image that contains clickable areas that act as a links to other URLs. An image has height and width. You can specify these two quantities in the IMG element. Although they are not mandatory, there are two good reasons to treat them as mandatory:
The IMG element has 11 attributes:
The IMG element is an empty element. INPUTThe INPUT element creates an input field. There are nine types of input fields.
The INPUT element has 13 attributes:
The INPUT element is an empty element. ISINDEX (Is Indexed)The ISINDEX element indicates that the document is a searchable index. It has one attribute:
The ISINDEX element is an empty element. KBD (Keyboard)The KBD element specifies that the browser should render contained text as keyboard input. There are no attributes. The KBD element is a container element that may contain content text and A, B, BASEFONT, BIG, BLINK, BR, CITE, CODE, EM, FONT, I, IMG, KBD, NOBR, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TT, VAR, and WBR elements. LI (List Item)The LI element creates an item in a list. It has two attributes:
The LI element is a container element that may contain content text and A, APPLET, B, BASEFONT, BIG, BLINK, BLOCKQUOTE, BR, CENTER, CITE, CODE, DIR, DL, EM, FONT, FORM, I, IMG, KBD, MENU, NOBR, OL, P, PRE, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TABLE, TT, UL, VAR, and WBR elements. It may not contain another LI element. LINKThe LINK element describes an association with another document. The LINK element is rarely used; its chief value lies in statically documenting an association with another document. It has two attributes:
The LINK element is an empty element. MAPThe MAP element describes a set of selectable areas within a client-side image map. It has one mandatory attribute, NAME=string, where the value gives a name that can be used by the IMG element in its USEMAP attribute. The MAP element is a container element that contains only AREA elements. MENUThe MENU element contains a list of items. It has no attributes, and is a container element that may contain APPLET, BLOCKQUOTE, CENTER, DIR, DL, FORM, LI, OL, P, PRE, TABLE, and UL elements. META (Document Meta-Information)The META element adds information to the document's HEAD element that does not fit anywhere else. It has three attributes:
You should use either the HTTP-EQUIV or the NAME attribute, but not both. The META element is an empty element. NOBR (No Break)The NOBR element prevents the browser from inserting line breaks. It has no attributes. The NOBR element is a container element that may contain content text and A, B, BASEFONT, BIG, BLINK, BR, CITE, CODE, EM, FONT, I, IMG, KBD, NOBR, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TT, VAR, and WBR elements. NOFRAMEThe NOFRAME element allows you to provide content for browsers that do not understand FRAMESET and FRAME elements. It has no attributes, and is a container element that may contain content text and A, ADDRESS, APPLET, B, BASEFONT, BIG, BLINK, BODY, BLOCKQUOTE, BR, CENTER, CITE, CODE, DIR, DIV, DL, EM, FONT, FORM, H1, H2, H3, H4, H5, H6, HR, I, IMG, KBD, MAP, MENU, NOBR, OL, P, PRE, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TABLE, TT, UL, VAR, and WBR elements. OL (Ordered List)The OL element contains a list that is strongly ordered in some fashion, such as an alphabetized list. It has three attributes:
The OL element is a container element that may only contain LI elements. OPTIONThe OPTION element specifies an option within a SELECT element. It has two attributes:
The OPTION element is a container element that may only contain content text. P (Paragraph)The P element contains a paragraph. It forces a break before and after the contained text. In response to strings of empty P elements, some browsers will increase the thickness of the break; others will not. The P element has five attributes:
The P element is a container element and may contain content text and A, B, BASEFONT, BIG, BLINK, BR, CITE, CODE, EM, FONT, I, IMG, KBD, NOBR, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TT, VAR, and WBR elements. PARAM (Applet Parameter)The PARAM element specifies a parameter for the containing APPLET element. It has two attributes:
The PARAM element is an empty container. PRE (Preformatted Text)The PRE element specifies that the browser is to render text as is, with its embedded line breaks and spaces intact. It has one attribute, WIDTH=number, where the value specifies the width of the text in characters. The browser should break the line after reaching the specified number of characters. The PRE element is a container element and may contain content text and the elements A, BR, and HR. SAMP (Literal Characters)The SAMP element indicates that the browser should render contained text as a sequence of literal characters. There are no attributes. The SAMP element is a container element that may contain content text and A, B, BASEFONT, BIG, BLINK, BR, CITE, CODE, EM, FONT, I, IMG, KBD, NOBR, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TT, VAR, and WBR elements. SCRIPTThe SCRIPT element contains JavaScript code. It has one attribute, LANGUAGE= string, which is used to specify the language. It has two values, LiveScript and JavaScript. There is very little difference between the two. You should always use the JavaScript value. The SCRIPT element is a container element that contains content text as JavaScript code. SELECTThe SELECT element specifies a set of options from which the user may choose. It has six attributes:
The SELECT element is a container that may only contain OPTION elements. SMALLThe SMALL element specifies that the browser should render the contents in a smaller than normal font. There are no attributes. The SMALL element is a container element that may contain content text and A, B, BASEFONT, BIG, BLINK, BR, CITE, CODE, EM, FONT, I, IMG, KBD, NOBR, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TT, VAR, and WBR elements. STRIKEThe STRIKE element specifies that the browser should render the contents in a strikethrough font. There are no attributes. The STRIKE element is a container element that may contain content text and A, B, BASEFONT, BIG, BLINK, BR, CITE, CODE, EM, FONT, I, IMG, KBD, NOBR, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TT, VAR, and WBR elements. STRONG (Strong Emphasis)The STRONG element indicates that the browser should strongly emphasize the contained text. There are no attributes. The STRONG element is a container element that may contain content text and A, B, BASEFONT, BIG, BLINK, BR, CITE, CODE, EM, FONT, I, IMG, KBD, NOBR, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TT, VAR, and WBR elements. SUB (Subscript)The SUB element specifies that the browser should render the contents as subscript. There are no attributes. The SUB element is a container element that may contain content text and A, B, BASEFONT, BIG, BLINK, BR, CITE, CODE, EM, FONT, I, IMG, KBD, NOBR, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TT, VAR, and WBR elements. SUP (Superscript)The SUP element specifies that the browser should render the contents as superscript. There are no attributes. The SUP element is a container element that may contain content text and A, B, BASEFONT, BIG, BLINK, BR, CITE, CODE, EM, FONT, I, IMG, KBD, NOBR, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TT, VAR, and WBR elements. TABLEThe TABLE element defines a table. It has ten attributes:
The TABLE element is a container element that may contain CAPTION and TR elements. TD (Table Data) and TH (Table Header)The TD element specifies the contents of a table cell. The TH element creates a header cell for a table. Typically, the browser will render the text of a TH element in a bold font; this is the only real difference between a TH element and a TD element. The TD and TH elements have seven attributes:
TD and TH elements are container elements that may contain content text and A, ADDRESS, APPLET, B, BASEFONT, BIG, BLINK, BLOCKQUOTE, BR, CENTER, CITE, CODE, DIR, DIV, DL, EM, FONT, FORM, H1, H2, H3, H4, H5, H6, HR, I, IMG, KBD, MAP, MENU, NOBR, OL, P, PRE, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TABLE, TT, UL, VAR, and WBR elements. An interesting "gotcha" is that a TD or TH element containing an IMG element, and nothing else, must contain no line breaks in the source. In other words,
will result in spaces before and after the image. Usually the goal is to have the image fill the cell completely. Here is the right way to do it:
TEXTAREAThe TEXTAREA element defines an input field in which multiple lines may be entered. It has eight attributes:
The TEXTAREA element is a container element that may only contain content text. TITLEThe TITLE element contains the document title, which is usually displayed in the browser window's decoration. It has no attributes, and is a container element that may only contain content text. You should limit the length of this element to 64 or fewer characters. TR (Table Row)The TR element defines a table row. It has four attributes:
The TR element is a container element that may contain TD and TH elements. TT (Teletype)The TT element specifies that the browser should render the contents in a fixed width teletype font. There are no attributes. The TT element is a container element that may contain content text and A, B, BASEFONT, BIG, BLINK, BR, CITE, CODE, EM, FONT, I, IMG, KBD, NOBR, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TT, VAR, and WBR elements. UL (Unordered List)The UL element creates a list that is not ordered. It has two attributes:
The UL element is a container element that may contain LI elements. VAR (Variable)The VAR element specifies that the browser should render the contained text as a variable name. There are no attributes. The VAR element is a container element that may contain content text and A, B, BASEFONT, BIG, BLINK, BR, CITE, CODE, EM, FONT, I, IMG, KBD, NOBR, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TT, VAR, and WBR elements. WBR (Word Break)The WBR element informs the browser where it can break a word. Unlike BR, it does not force a line break. You can use WBR elements within a NOBR element to dictate precisely where the browser may break a line and where it may not. The WBR element has no attributes and is an empty element. |