Quick HTML Reference
By Maran Wilson
Reposted on HTML Goodies with permission.
TOP| BASIC STRUCTURE| MULTIMEDIA| LINKS| LISTS| FRAMES| TABLES| FORMS| STYLE| GENERAL FORMATTING| BOTTOM
Basic Structure:
- <!-- ..... -->
Specifies a comment. Anything between these tags will be skipped by the browser. - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 //EN">
This is the necessary first element of any HTML 3.2 compliant document. - <HTML>.....< /HTML>
Encloses the entire document. - <HEAD>.....< /HEAD>
Encloses the head of the document. The following optional tags are placed inside the head. - <TITLE>.....< /TITLE>
Indicates the title of the document that is used as the window caption. This is the second of the two required tags for any HTML 3.2 compliant document. - <BASE href="
Specifies the base URL of the document. This is used when dereferencing relative URLs in the page. - <BASE href=" TARGET="...">
Also specifies the base target frame that all links will default to. See the LINK tag for possible values used in TARGET. - META attribut1 attribute2>
This element can be used to specify name/value pairs describing various properties of the document. Below are some examples:
To have your page automatically reloaded every X seconds, use the following:
<META HTTP-EQUIV="REFRESH" CONTENT=X >
To have a different page automatically loaded after X seconds, use the following:
<META HTTP-EQUIV="REFRESH" CONTENT="X; URL=
To specify an expiration date for the page so that it will be reloaded after a certain date, use:
<META HTTP-EQUIV="Expires" CONTENT="Mon, 23 Sep 1996 01:21:00 GMT">
To specify keywords for certain search services to use, do the following:
<META HTTP-EQUIV="Keywords" CONTENT="keyword1, keyword2, ...">
To specify a description of your page for certain search services to use, do the following:
<META HTTP-EQUIV="Description" CONTENT="Describe your site here...."> - <LINK attribute=" HREF="..." >
Currently this tag is not widely supported, however in the future browsers will use a list of these tags to generate a navigation bar for the site. Without browser support, this tag can still be useful for site maintenance.
Attributes:
- REL="..."--Specifies the type of relationship of the link to this page. Possible values are: "home", "toc" (table of contents), "index", "glossary", "copyright", "bookmark", "up", "next", "previous", and "help".
- REV="..."--Used instead of REL, this specifies a reverse relationship from this page to the link. Possible values are: "made" (author, set HREF=email address) and all the ones used in REL.
- HREF="..."--Specifies the address of the link.
- TITLE="..."--Specifies a title for the link.
- <BODY attribute1="..." attribute2="...">.....< /BODY>
Encloses the main body of the document.
Attributes:
- ALINK="..."--Specifies the color of the activated links in the page.
- BACKGROUND="..."--Specifies an image to be tiled as background.
- BGCOLOR="..."--Specifies the background color.
- BGPROPERTIES=FIXED--Fixes the background image so that it doesn't scroll. (IE)
- LEFTMARGIN="n"--Specifies the left margin for the entire page. (IE)
- LINK="..."--Specifies the color of the links in the page.
- TEXT="..."--Specifies the color of the text in the page.
- TOPMARGIN="n"--Specifies the top margin for the entire page. (IE)
- VLINK="..."--Specifies the color of the followed links in the page.
NOTE:Color is always expressed as RGB (Red Green Blue), where each color has a value between 0 and 255 expressed in hex notation. For example, BGCOLOR=#FFFF00 sets the background color to yellow. For more information check out Colors of the Web.
- <BASEFONT attribute=">
Sets the default font properties for the entire page.
Attributes:
- SIZE="..."--Sets the size of the font to any number between 1 and 7 with 3 being default. Relative sizes also work, e.g. SIZE=+2 .
- COLOR="..."--Specifies the default font color for the page.
- Name="..."--Specifies the typeface of the default font.
- <Hn>...< /Hn>
Makes the enclosed text a heading of various sizes where n is any number ranging from 1 to 6, and 1 creates the biggest heading while 6 creates the smallest. - <ISINDEX>
Displays a text box indicating the presence of a searchable index. Simply adding this tag will not create a searchable page. The server must be set up to support it.
Attributes:
- ACTION="..."--Specifies the location of the gateway program to which the search string should be passed.
- PROMPT="..."--Specifies an alternate prompt for the text box.
TOP | BASIC STRUCTURE | MULTIMEDIA | LINKS | LISTS | FRAMES | TABLES | FORMS | STYLE | GENERAL FORMATTING | BOTTOM
Multimedia:
- <IMG attribute1 attribute2>
Places an inline image into the document.
Attributes:
- SRC="..."--Specifies the URL of the image.
- DYNSRC="..."--Specifies the URL of a video clip or VRML world. An image can also be specified first using SRC= to cover for browsers that do not support videos. (IE)
- CONTROLS--Adds a set of controls under the video clip. (IE)
- LOOP="n"--For video clips, specifies the number of times to loop the clip. A value of "-1" or "INFINITE" makes it loop indefinitely. (IE)
- START="..."--Specifies when the video clip should start playing. Possible values are "FILEOPEN" (default), "MOUSEOVER", or both.(IE)
- USEMAP="#map1" --Tells the browser that the image is a client-side clickable image map defined under the name "map1".
- ISMAP --Tells the browser that the image is a server-side clickable image map.
- ALT="..."--Specifies a text string to be displayed on browsers that do not support inline images.
- BORDER="..."--Specifies the width of the border drawn around the image. If BORDER is set to "0", there will be no border even around pictures that are links.
- LOWSRC="..."--Specifies the URL of an image to be loaded first, before the image specified in SRC is loaded. LOWSRC usually reefers to a smaller image.
- ALIGN="..."--Specifies the alignment of the image.
Values:
- RIGHT or LEFT--Aligns the image to the specified side of the page, and all text is wrapped around the image.
- TOP, MIDDLE, BOTTOM, TEXTTOP, ABSMIDDLE, BASELINE, and ABSBOTTOM--Specifies the vertical alignment of the image with other items on the same line.
- VSPACE="..."--Specifies the space left between the edge of the image and the items above or below it.
- HSPACE="..."--Specifies the space left between the edge of the image and the items to the left or right of it.
- WIDTH="..."--Specifies the width of the image. If the width is not the actual width, the image is scaled to fit.
- HEIGHT="..."--Same as above ,except it specifies the height of the image.
- <MAP attribute>...< /MAP>
Specifies a collection of hot spots that define a client-side image map. The AREA tag can be used inside to define the hot spots.
Attributes:
- NAME="..."--Specifies the name of the map so that it can be referred to later.
- <AREA attribute1 attribute2>...< /AREA>
Specifies the shape and size of a hot spot to be used in the definition of a client-side image map. Used inside the MAP tag.
Attributes:
- SHAPE="..."--Specifies the shape of the hot spot. Possible values are RECT, RECTANGLE, CIRC, CIRCLE, POLY, or POLYGON.
- COORDS="..."--Specifies the coordinates that define the hot spot's position. Two pairs of coordinates are needed for RECT, three or more pairs for POLY, and one pair of coordinates and a radius for CIRC.
- HREF="..."--Specifies the URL that this hot spot points to.
- NOHREF--Indicates that this hot spot points to nothing.
- TARGET="..."--Specifies which window the link will be loaded into. The target can be a name of a frame that you specified in the FRAME tag or one of the following:
Values:
- "_blank"--Loads the link into a new blank window.
- "_parent"--Loads the link into the immediate parent of the document the link is in.
- "_self"--Loads the link into the same window. (default)
- "_top"--Loads the link into the full body of the current window.
- <BGSOUND attribute1 attribute2>(IE)
Specifies a background sound to be played whenever the page is loaded. This "soundtrack" can be either a sample (.wav or .au) or midi (.mid) file.
Attributes:
- SRC="..."--Specifies the URL of the sound to be played.
- LOOP="n"--Specifies the number of times the sound will loop. Values of "-1" or "INFINITE" make the sound loop indefinitely.
- <MARQUEE attribute1 attribute2>...< /MARQUEE>(IE)
Places a scrolling text marquee into the document.
Attributes:
- ALIGN="..."-- Possible values of "TOP", "MIDDLE", or "BOTTOM". Specifies the alignment of the text around the marquee with respect to the marquee.
- BEHAVIOR="..."--Possible values of "SCROLL" (default), "SLIDE", or "ALTERNATE". Specifies the behavior of the marquee text. "SCROLL" is the default, "SLIDE" makes the text start from off the screen and then stick, "ALTERNATE" makes the text alternate back and forth repeatedly.
- BGCOLOR="..."--Specifies the background color of the marquee.
- DIRECTION="..."--Possible values are "LEFT" (default) or "RIGHT". Specifies the direction for the text to scroll.
- HEIGHT="..."--Specifies the height of the marquee in number of pixels or % of screen.
- HSPACE="n"--Specifies the left and right margins of the outside of the marquee in pixels.
- LOOP="n"--Specifies the number of times the marquee will loop. Values of "-1" or "INFINITE" make the marquee loop indefinitely.
- SCROLLAMOUNT="n"--Specifies the number of pixels between each successive draw of the marquee text.
- SCROLLDELAY="n"--Specifies the number of milliseconds between each successive draw of the marquee text.
- VSPACE="n"--Specifies the top and bottom margin for the outside of the marquee.
- WIDTH="..."--Specifies the width of the marquee either in pixel or in a percentage of the screen.
- <APPLET attribute1 attribute2> parameter1 parameter2 ... < /APPLET>
Inserts a Java applet in the HTML document. Any text placed between the opening and closing APPLET tags will be displayed by browsers that do not support JAVA.
Attributes:
- ALIGN="..."-- Possible values of "LEFT", "RIGHT", "TOP", "MIDDLE", or "BOTTOM". Specifies the alignment of the text around the object with respect to the object.
- ALT="..."--Specifies the text to be displayed by browsers that recognize the tag but cannot show applets.
- CODE="..."--Specifies the name of the Java applet.
- CODEBASE="..."--Specifies the base address of the applet. The directory in which the applet is located.
- DOWNLOAD=n--Specifies an order in which images are downloaded.
- HIGHT="..."--Specifies the height of the applet in number of pixels or % of screen.
- HSPACE="n"--Specifies the left and right margins of the outside of the applet in pixels.
- NAME="..."--Specifies the name of the applet instance, in case there are more than one of the same applet on the page.
- VSPACE="n"--Specifies the top and bottom margin for the outside of the applet.
- WIDTH="..."--Specifies the width of the applet either in pixel or in a percentage of the screen.
Parameters:
These are the applet-specific parameters that are passed as arguments to the program. They are specified as tags within the APPLET tag as follows: <PARAM NAME="..." VALUE="..." >
- <EMBED attribute1 attribute2< /EMBED>
Inserts an embedded multimedia object, such as a sound file or video, into the page. In the future, when the OBJECT tag becomes finalized and well supported, this tag will be obsolete.
Attributes:
- AUTOSTART="..."--Specifies whether the file starts playing right away or not. Possible values are "TRUE" or "FALSE".
- HIGHT="..."--Specifies the height of the display in number of pixels or % of screen.
- LOOP="..."--Specifies whether the file repeats or not. Possible values are "TRUE" or "FALSE".
- NAME="..."--Specifies the name of the object, in case there are other objects that refer to this one.
- SRC="..."--Specifies the location of the object file.
- WIDTH="..."--Specifies the width of the display either in pixel or in a percentage of the screen.
- <SCRIPT attribute>...script statements...< /SCRIPT>
Encloses scripting language statements to be executed by the browser. To ensure backward compatibility, enclose the script statements in comment tags (<!-- ... -->)
Attributes:
- LANGUAGE="..."--Specifies which language is being used in the script such as "VBScript" or "JavaScript".
- SRC="..."--Specifies the location of a file containing the script. This can be used if you don't want the code to be on the same HTML file.
- <NOSCRIPT>...< /NOSCRIPT>
Encloses anything you want displayed by browsers that do not support inline scripts. These go inside the SCRIPT tags.
TOP | BASIC STRUCTURE | MULTIMEDIA | LINKS | LISTS | FRAMES | TABLES | FORMS | STYLE | GENERAL FORMATTING | BOTTOM
Links:
- <A attribute="...">...< /A>
When used with the HREF attribute, the enclosed text and/or graphic becomes a link to another document or anchor. When used with the NAME attribute, the enclosed text and/or graphic becomes an anchor.
Attributes:
- HREF="..."--Specifies the URL of the document to be linked to.
- NAME="..."--Specifies the name of the anchor you are creating.
- onClick="--Specifies a script to be activated when the mouse is clicked.
- onMouseOver="--Specifies a script to be activated when the mouse is moved over the link.
- REL="..."--Specifies a relative relationship.
- REV="..."--Specifies the reverse relationship.
- TARGET="..."--Specifies which window the link will be loaded into. The target can be a name of a frame that you specified in the FRAME tag or one of the following:
Values:
- "_blank"--Loads the link into a new blank window.
- "_parent"--Loads the link into the immediate parent of the document the link is in.
- "_self"--Loads the link into the same window. (default)
- "_top"--Loads the link into the full body of the current window.
- TITLE="..."--Specifies the title that appears when the link is selected, but not yet clicked.
TOP | BASIC STRUCTURE | MULTIMEDIA | LINKS | LISTS | FRAMES | TABLES | FORMS | STYLE | GENERAL FORMATTING | BOTTOM
Lists:
- <LI attribute>
Used to mark text as a list item in any of the following list types: <DIR>, <MENU>, <OL>, or <UL>.
Attributes:
- TYPE="..."--Specifies the type of bullet used to label the item. Possible values are: DISC, CIRCLE, SQUARE, A, a, I, i, 1.
- VALUE="..."--Specifies the number assigned to the item.
- <DIR>...< /DIR>
Puts the enclosed items marked with <LI>, in a directory listing. - <MENU>...< /MENU>
Puts the enclosed items marked with <LI>, in a menu list. - <OL attribute>...< /OL>
Puts the enclosed items marked with <LI>, in a numbered list.
Attributes:
- TYPE="..."--Specifies the type of numbering used to label the item. Possible values are: A, a, I, i, 1.
- START="..."--Specifies the starting value for the numbering.
- <UL attribute>...< /UL>
Puts the enclosed items marked with <LI>, in a bulleted list.
Attributes:
- TYPE="..."--Specifies the type of bullet used to label the item. Possible values are: DISC, CIRCLE, SQUARE.
- <DL>...< /DL>
Creates a definition list. Within this container, <DT> specifies a definition term and <DD> specifies the definition.
TOP | BASIC STRUCTURE | MULTIMEDIA | LINKS | LISTS | FRAMES | TABLES | FORMS | STYLE | GENERAL FORMATTING | BOTTOM
Frames:
- <FRAMESET attribute1="..." attribute2="...">...< /FRAMESET>
Defines a set of frames that will make up the page. The FRAME, and NOFRAMES tags go inside this. The FRAMESET tag is used instead of the BODY tag. You can, however, include a BODY tag inside the NOFRAMES tags for browsers that do not support frames.
Attributes:
- BORDER="..."--Specifies the width (in pixels) of the border drawn around the frames.(Netscape)
- COLS="..."--Creates the frames as columns and specifies the width of each column. Width of the columns can be set using percentages (%), pixels, or relative size (*). For example, if you want your frames to be 3 equally sized columns, you would use: COLS=33%,33%,*
- FRAMEBORDER="..."--Specifies whether or not a 3-D border is displayed around the frames. possible values are 0 (no border) or 1 (default).(IE)
- FRAMESPACING="..."--Specifies in pixels, the amount of space between the frames.
- ROWS="..."--Creates the frames as rows and specifies the width of each row. width of the rows can be set using percentages (%), pixels, or relative size (*). For example, if you want a small frame at the top of your page and one large frame below that, you might use: ROWS=15%,*
- SCROLLING="..."--Determines whether or not scroll bars are displayed on all the frames. Possible values are "yes", "no", and "auto".
- <FRAME attribute1="..." attribute2="...">
Defines a single frame within a frameset.
Attributes:
- BORDER="..."--Specifies the width (in pixels) of the border drawn around the frame.(Netscape)
- FRAMEBORDER="..."--Specifies whether or not a 3-D border is displayed around the frame. possible values are 0 (no border) or 1 (default).(IE)
- MARGINHEIGHT="..."--Specifies the top and bottom margins of the frame in pixels.
- MARGINWIDTH="..."--Specifies the right and left margins of the frame in pixels.
- NAME="..."--Defines a target name for the frame.
- NORESIZE--Prevents the frame from being resized by the user
- SCROLLING="..."--Determines whether or not scroll bars are displayed along the frame. Possible values are "yes", "no", and "auto".
- SRC="..."--Specifies the source file for the frame.
- <IFRAME attribute1="..." attribute2="..."< /IFRAME>(IE)
Defines a floating frame. Does not need to be placed within a FRAMESET.
Attributes:
- ALIGN="..."--Specifies the alignment of the floating frame and surrounding text. Possible values are TOP, MIDDLE, BOTTOM, LEFT, and RIGHT.
- FRAMEBORDER="..."--Specifies whether or not a 3-D border is displayed around the frame. possible values are 0 (no border) or 1 (default)
- HEIGHT="..."--Specifies the height of the floating frame.
- MARGINHEIGHT="..."--Specifies the top and bottom margins of the floating frame in pixels.
- MARGINWIDTH="..."--Specifies the right and left margins of the floating frame in pixels.
- NAME="..."--Defines a target name for the floating frame.
- NORESIZE--Prevents the frame from being resized by the user
- SCROLLING="..."--Determines whether or not scroll bars are displayed along the frame. Possible values are "yes" and "no".
- SRC="..."--Specifies the source file for the floating frame.
- WIDTH="..."--Specifies the width of the floating frame.
- <NOFRAMES>...< /NOFRAMES>
Placed inside the FRAMESET, anything between the beginning and ending of this tag is viewable only by browsers that do not support frames. This tag is used to create pages that are compatible with older browsers that do not support frames.
TOP | BASIC STRUCTURE | MULTIMEDIA | LINKS | LISTS | FRAMES | TABLES | FORMS | STYLE | GENERAL FORMATTING | BOTTOM