Thursday, November 21, 2024

Quick HTML Reference



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.


    1. <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.



    2. <BASE href=”http://some.network/file.html”>

      Specifies the base URL of the document. This is used when dereferencing relative URLs in the page.



    3. <BASE href=”http://some.net/file.html” TARGET=”…”>

      Also specifies the base target frame that all links will default to. See the LINK tag for possible values used in TARGET.



    4. <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=http://some.address/file.html”>

      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….”>



    5. <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:

      1. 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”.
      2. 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.
      3. HREF=”…”–Specifies the address of the link.
      4. TITLE=”…”–Specifies a title for the link.


  • <BODY attribute1=”…” attribute2=”…”>…..< /BODY>

    Encloses the main body of the document.


      Attributes:

    1. ALINK=”…”–Specifies the color of the activated links in the page.
    2. BACKGROUND=”…”–Specifies an image to be tiled as background.
    3. BGCOLOR=”…”–Specifies the background color.
    4. BGPROPERTIES=FIXED–Fixes the background image so that it doesn’t scroll. (IE)
    5. LEFTMARGIN=”n”–Specifies the left margin for the entire page. (IE)
    6. LINK=”…”–Specifies the color of the links in the page.
    7. TEXT=”…”–Specifies the color of the text in the page.
    8. TOPMARGIN=”n”–Specifies the top margin for the entire page. (IE)
    9. 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:

    1. 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 .
    2. COLOR=”…”–Specifies the default font color for the page.
    3. 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:

    1. ACTION=”…”–Specifies the location of the gateway program to which the search string should be passed.
    2. 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:

    1. SRC=”…”–Specifies the URL of the image.
    2. 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)
    3. CONTROLS–Adds a set of controls under the video clip. (IE)
    4. 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)
    5. START=”…”–Specifies when the video clip should start playing. Possible values are “FILEOPEN” (default), “MOUSEOVER”, or both.(IE)
    6. USEMAP=”#map1″ –Tells the browser that the image is a client-side clickable image map defined under the name “map1”.
    7. ISMAP –Tells the browser that the image is a server-side clickable image map.
    8. ALT=”…”–Specifies a text string to be displayed on browsers that do not support inline images.
    9. 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.
    10. 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.
    11. ALIGN=”…”–Specifies the alignment of the image.

        Values:

      1. RIGHT or LEFT–Aligns the image to the specified side of the page, and all text is wrapped around the image.
      2. TOP, MIDDLE, BOTTOM, TEXTTOP, ABSMIDDLE, BASELINE, and ABSBOTTOM–Specifies the vertical alignment of the image with other items on the same line.



    12. VSPACE=”…”–Specifies the space left between the edge of the image and the items above or below it.
    13. HSPACE=”…”–Specifies the space left between the edge of the image and the items to the left or right of it.
    14. WIDTH=”…”–Specifies the width of the image. If the width is not the actual width, the image is scaled to fit.
    15. 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:

    1. 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:

    1. SHAPE=”…”–Specifies the shape of the hot spot. Possible values are RECT, RECTANGLE, CIRC, CIRCLE, POLY, or POLYGON.
    2. 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.
    3. HREF=”…”–Specifies the URL that this hot spot points to.
    4. NOHREF–Indicates that this hot spot points to nothing.
    5. 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:

      1. “_blank”–Loads the link into a new blank window.
      2. “_parent”–Loads the link into the immediate parent of the document the link is in.
      3. “_self”–Loads the link into the same window. (default)
      4. “_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:

    1. SRC=”…”–Specifies the URL of the sound to be played.
    2. 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:

    1. ALIGN=”…”– Possible values of “TOP”, “MIDDLE”, or “BOTTOM”. Specifies the alignment of the text around the marquee with respect to the marquee.
    2. 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.
    3. BGCOLOR=”…”–Specifies the background color of the marquee.
    4. DIRECTION=”…”–Possible values are “LEFT” (default) or “RIGHT”. Specifies the direction for the text to scroll.
    5. HEIGHT=”…”–Specifies the height of the marquee in number of pixels or % of screen.
    6. HSPACE=”n”–Specifies the left and right margins of the outside of the marquee in pixels.
    7. LOOP=”n”–Specifies the number of times the marquee will loop. Values of “-1” or “INFINITE” make the marquee loop indefinitely.
    8. SCROLLAMOUNT=”n”–Specifies the number of pixels between each successive draw of the marquee text.
    9. SCROLLDELAY=”n”–Specifies the number of milliseconds between each successive draw of the marquee text.
    10. VSPACE=”n”–Specifies the top and bottom margin for the outside of the marquee.
    11. 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:

    1. ALIGN=”…”– Possible values of “LEFT”, “RIGHT”, “TOP”, “MIDDLE”, or “BOTTOM”. Specifies the alignment of the text around the object with respect to the object.
    2. ALT=”…”–Specifies the text to be displayed by browsers that recognize the tag but cannot show applets.
    3. CODE=”…”–Specifies the name of the Java applet.
    4. CODEBASE=”…”–Specifies the base address of the applet. The directory in which the applet is located.
    5. DOWNLOAD=n–Specifies an order in which images are downloaded.
    6. HIGHT=”…”–Specifies the height of the applet in number of pixels or % of screen.
    7. HSPACE=”n”–Specifies the left and right margins of the outside of the applet in pixels.
    8. NAME=”…”–Specifies the name of the applet instance, in case there are more than one of the same applet on the page.
    9. VSPACE=”n”–Specifies the top and bottom margin for the outside of the applet.
    10. 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:

    1. AUTOSTART=”…”–Specifies whether the file starts playing right away or not. Possible values are “TRUE” or “FALSE”.
    2. HIGHT=”…”–Specifies the height of the display in number of pixels or % of screen.
    3. LOOP=”…”–Specifies whether the file repeats or not. Possible values are “TRUE” or “FALSE”.
    4. NAME=”…”–Specifies the name of the object, in case there are other objects that refer to this one.
    5. SRC=”…”–Specifies the location of the object file.
    6. 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:

    1. LANGUAGE=”…”–Specifies which language is being used in the script such as “VBScript” or “JavaScript”.

    2. 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:

    1. HREF=”…”–Specifies the URL of the document to be linked to.
    2. NAME=”…”–Specifies the name of the anchor you are creating.
    3. onClick=”–Specifies a script to be activated when the mouse is clicked.
    4. onMouseOver=”–Specifies a script to be activated when the mouse is moved over the link.
    5. REL=”…”–Specifies a relative relationship.
    6. REV=”…”–Specifies the reverse relationship.
    7. 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:

      1. “_blank”–Loads the link into a new blank window.
      2. “_parent”–Loads the link into the immediate parent of the document the link is in.
      3. “_self”–Loads the link into the same window. (default)
      4. “_top”–Loads the link into the full body of the current window.



    8. 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:

    1. TYPE=”…”–Specifies the type of bullet used to label the item. Possible values are: DISC, CIRCLE, SQUARE, A, a, I, i, 1.
    2. 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:

    1. TYPE=”…”–Specifies the type of numbering used to label the item. Possible values are: A, a, I, i, 1.
    2. START=”…”–Specifies the starting value for the numbering.


  • <UL attribute>…< /UL>

    Puts the enclosed items marked with <LI>, in a bulleted list.

      Attributes:

    1. 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:

    1. BORDER=”…”–Specifies the width (in pixels) of the border drawn around the frames.(Netscape)

    2. 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%,*
    3. FRAMEBORDER=”…”–Specifies whether or not a 3-D border is displayed around the frames. possible values are 0 (no border) or 1 (default).(IE)

    4. FRAMESPACING=”…”–Specifies in pixels, the amount of space between the frames.
    5. 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%,*
    6. 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:

    1. BORDER=”…”–Specifies the width (in pixels) of the border drawn around the frame.(Netscape)

    2. FRAMEBORDER=”…”–Specifies whether or not a 3-D border is displayed around the frame. possible values are 0 (no border) or 1 (default).(IE)

    3. MARGINHEIGHT=”…”–Specifies the top and bottom margins of the frame in pixels.
    4. MARGINWIDTH=”…”–Specifies the right and left margins of the frame in pixels.
    5. NAME=”…”–Defines a target name for the frame.
    6. NORESIZE–Prevents the frame from being resized by the user
    7. SCROLLING=”…”–Determines whether or not scroll bars are displayed along the frame. Possible values are “yes”, “no”, and “auto”.
    8. 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:

    1. ALIGN=”…”–Specifies the alignment of the floating frame and surrounding text. Possible values are TOP, MIDDLE, BOTTOM, LEFT, and RIGHT.
    2. FRAMEBORDER=”…”–Specifies whether or not a 3-D border is displayed around the frame. possible values are 0 (no border) or 1 (default)
    3. HEIGHT=”…”–Specifies the height of the floating frame.
    4. MARGINHEIGHT=”…”–Specifies the top and bottom margins of the floating frame in pixels.
    5. MARGINWIDTH=”…”–Specifies the right and left margins of the floating frame in pixels.
    6. NAME=”…”–Defines a target name for the floating frame.
    7. NORESIZE–Prevents the frame from being resized by the user
    8. SCROLLING=”…”–Determines whether or not scroll bars are displayed along the frame. Possible values are “yes” and “no”.
    9. SRC=”…”–Specifies the source file for the floating frame.
    10. 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

Tables:


  • <TABLE attribute1=”…” attribute2=”…”>…< /TABLE>

    Creates a table that can include any number of rows.

      Attributes:

    1. BORDER=”…”–Specifies the width of the border around the table. If set to 0, there will be no border.
    2. BACKGROUND=”…”–Specifies the address of an image to be tiled as background.(IE)
    3. BGCOLOR=”…”–Specifies the background color of the table.
    4. BORDERCOLOR=”…”–Specifies the border color of the table.
    5. BORDERCOLORLIGHT=”…”–Specifies the lighter color used in creating the 3D borders independently.(IE)
    6. BORDERCOLORDARK=”…”–Specifies the darker color used in creating the 3D borders independently.(IE)
    7. WIDTH=”…”–Specifies the width of the table on the page.
    8. CELLSPACING=”…”–Specifies the amount of space between the cells in the table.
    9. CELLPADDING=”…”–Specifies the amount of space between the edges of the cell and the text inside.
    10. FRAME=”…”–Specifies which sides of the outer border of the table are displayed.(IE)

        Possible types:

      1. VOID–No outside borders are displayed.
      2. ABOVE–Displays a border on the top side of the table.
      3. BELOW–Displays a border on the bottom side of the table.
      4. HSIDES–Displays the top and bottom borders of the table.
      5. LHS–Displays the left-hand side border.
      6. RHS–Displays the right-hand side border.
      7. VSIDES–Displays the right and left side borders.
      8. BOX–Displays a border on all sides of the table.
      9. BORDER–Displays a border on all sides of the table.



    11. HEIGHT=”…”–Specifies the height of the table on the page.
    12. RULES=”…”–Specifies which inner borders of the table are displayed.(IE)

        Possible types:

      1. NONE–No inside borders are displayed.
      2. GROUPS–Displays inner borders between the various table groups such as THEAD, TFOOT, TBODY, and COLGROUP groups.
      3. ROWS–Displays inner borders between the table rows.
      4. COLS–Displays inner borders between the table columns.
      5. ALL–Displays inner borders between all rows and columns.




  • <CAPTION attribute1=”…”>…< /CAPTION>

    Specifies the caption of the table.

      Attributes:

    1. ALIGN=”…”–Specifies the position of the caption. Possible values are LEFT, RIGHT, BOTTOM, or TOP.



  • <TR attribute1=”…” attribute2=”…”>…< /TR>

    Specifies a table row. It can enclose the table heading and table data.

      Attributes:

    1. ALIGN=”…”–Specifies the horizontal alignment of the row contents. Possible values are LEFT, RIGHT, and CENTER.
    2. BGCOLOR=”…”–Specifies the background color for the row.
    3. BORDERCOLOR=”…”–Specifies the border color of the row.
    4. BORDERCOLORLIGHT=”…”–Specifies the lighter color used in creating the 3D borders independently.(IE)
    5. BORDERCOLORDARK=”…”–Specifies the darker color used in creating the 3D borders independently.(IE)
    6. VALIGN=”…”–Specifies the vertical alignment of the row contents. Possible values are TOP, MIDDLE, BOTTOM, and BASELINE.
    7. HEIGHT=”…”–Specifies the height of the cell.



  • <TH attribute1=”…” attribute2=”…”>…< /TH>

    Makes the cell a table heading.

      Attributes:

    1. ALIGN=”…”–Specifies the horizontal alignment of the cell contents. Possible values are LEFT, RIGHT, and CENTER.
    2. NOWRAP–Prevents word wrapping within the cell
    3. BGCOLOR=”…”–Specifies the background color for the cell.
    4. BACKGROUND=”…”–Specifies the address of an image to be tiled as background.(IE)
    5. BORDERCOLOR=”…”–Specifies the border color of the cell.
    6. BORDERCOLORLIGHT=”…”–Specifies the lighter color used in creating the 3D borders independently.(IE)
    7. BORDERCOLORDARK=”…”–Specifies the darker color used in creating the 3D borders independently.(IE)
    8. VALIGN=”…”–Specifies the vertical alignment of the cell contents. Possible values are TOP, MIDDLE, BOTTOM, and BASELINE.
    9. ROWSPAN=”…”–Specifies the number of rows the cell will span.
    10. COLSPAN=”…”–Specifies the number of columns the cell will span.
    11. WIDTH=”…”–Specifies the width of the cell.
    12. HEIGHT=”…”–Specifies the height of the cell.



  • <TD attribute1=”…” attribute2=”…”>

    These go inside the TR tags and they define the data in a cell. End tag may be used.

      Attributes:

    1. BACKGROUND=”…”–Specifies the address of an image to be tiled as background. (IE)
    2. BGCOLOR=”…”–Specifies the background color for the individual cell.
    3. BORDERCOLOR=”…”–Specifies the border color of the cell.
    4. BORDERCOLORLIGHT=”…”–Specifies the lighter color used in creating the 3D borders independently.(IE)
    5. BORDERCOLORDARK=”…”–Specifies the darker color used in creating the 3D borders independently.(IE)
    6. ALIGN=”…”–Specifies the horizontal alignment of the cell contents. Possible values are LEFT, RIGHT, and CENTER.
    7. NOWRAP–Prevents word wrapping within the cell
    8. VALIGN=”…”–Specifies the vertical alignment of the cell contents. Possible values are TOP, MIDDLE, BOTTOM, and BASELINE.
    9. ROWSPAN=”…”–Specifies the number of rows the cell will span.
    10. COLSPAN=”…”–Specifies the number of columns the cell will span.
    11. WIDTH=”…”–Specifies the width of the cell.
    12. HEIGHT=”…”–Specifies the height of the cell.



  • <COLGROUP attribute1=”…” attribute2=”…”>(IE)

    Specifies the properties of one or more columns. This tag generally goes right after the opening TABLE tag.

      Attributes:

    1. ALIGN=”…”–Specifies the position of the text within the cells of the Columns. Possible values are CENTER, LEFT, RIGHT, BOTTOM, or TOP.
    2. SPAN=”…”–Specifies the number of columns for which these attributes will apply.



  • <COL attribute1=”…” attribute2=”…”>(IE)

    Used with the COLGROUP tag, this specifies the properties of one column. This tag overrides any attributes specified in the COLGROUP tag that comes right before it.

      Attributes:

    1. ALIGN=”…”–Specifies the position of the text within the cells of the Column. Possible values are CENTER, LEFT, RIGHT, BOTTOM, or TOP.
    2. SPAN=”…”–Specifies the number of columns for which these attributes will apply.

  • <TBODY>…< /TBODY>(IE)

    Encloses the body of your table. This tag is optional unless you are using the THEAD or TFOOT tags. It used to separate the rows in the table from those in the header or footer.
  • <TFOOT>…< /TFOOT>(IE)

    Encloses the table rows that are to be used as a footer. It is an optional tag and comes right after the ending TBODY element.
  • <THEAD>…< /THEAD>(IE)

    Encloses the table rows that are to be used as a header. It is an optional tag and comes before the opening TBODY element.


TOP |
BASIC STRUCTURE |
MULTIMEDIA |
LINKS |
LISTS |
FRAMES |
TABLES |
FORMS |
STYLE |
GENERAL FORMATTING |
BOTTOM

Forms:


  • <FORM attribute1=”…” attribute2=”…”>…..< /FORM>

    Specifies a form. Forms can be used to send user input to the server in the form of NAME/VALUE pairs.

      Attributes:

    1. ACTION=”…”–Specifies the address to be used in carrying out the action of the form. Usually the address of the CGI file. You can also specify a mailto address to have the contents of the form emailed to you instead of getting
      passed to the server. (in future browsers)
    2. METHOD=”…”–Specifies the method used by the server in sending the form information. Possible values are POST or GET. When GET is used, the server simply appends the arguments to the end of the action address. With POST, the information is sent as an HTTP post transaction.
    3. TARGET=”…”–Specifies which window the result of the form 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:

      1. “_blank”–Loads the result into a new blank window.
      2. “_parent”–Loads the result into the immediate parent of the document the form is in.
      3. “_self”–Loads the result into the same window. (default)
      4. “_top”–Loads the result into the full body of the current window.



    4. ENCTYPE=”…”–For future browser. Specifies the type of encoding to use on the form information.



  • <INPUT attribute1=”…” attribute2=”…”>

    Specifies a control or input area for a form, from which a NAME/VALUE pair will be returned to the server.

      Attributes:

    1. ALIGN=”…”–If the TYPE is IMAGE, then this specifies the alignment of the surrounding text with the image. Possible values are TOP, MIDDLE, BOTTOM, LEFT, or RIGHT.
    2. CHECKED–Use this attribute in a RADIO or CHECKBOX type, and it will be pre-selected when the form loads.
    3. MAXLENGTH=”…”–Specifies the maximum number of characters that can be entered in a text input.
    4. NAME=”…”–Specifies the name of the control or input area. (Part of the NAME/VALUE pair)
    5. SIZE=”…”–Specifies the size of the text entry area that is displayed by the browser.
    6. SRC=”…”–If the TYPE is IMAGE, then this specifies the address of the image to be used.
    7. VALUE=”…”–Specifies the value to be submitted along with the corresponding name(Part of the NAME/VALUE pair). Specifies the default text string for TEXT. For RESET and SUBMIT, this specifies the text string to be displayed on the 3-D button.
    8. TYPE=”…”–Specifies the type of control being used.

        Possible types:

      1. CHECKBOX–Creates a checkbox. If the user checks it, the corresponding name/value pair is sent to the server.
      2. HIDDEN–Nothing is displayed by the browser, but the information is still sent to the server.
      3. IMAGE–Like the SUBMIT type, you can have the form sent immediately when the user clicks on an image. Along with the normal information, when a from is submitted by clicking on an image, the coordinates of the clicked point (measured in pixels from the upper-left corner of the image) are also sent. The x-coordinate is submitted with a “.x” appended to the name and the y-coordinate has a “.y” appended to the name.
      4. PASSWORD–Creates a single line entry text box just like the TEXT type, however, user input is not echoed on the screen.
      5. RADIO–Creates a radio list of alternatives of which only one can be selected. Each alternative must have the same name, but different values can be assigned to each.
      6. RESET–Creates a 3-D button that clears the entire form to original values when clicked. You can give the button a name by using the VALUE attribute.
      7. SUBMIT–Creates a 3-D button that submits the form when clicked. You can give the button a name by using the VALUE attribute.
      8. TEXT–Creates a single line text entry box. You can specify the size of the text box by using the SIZE attribute.




  • <SELECT attribute1=”…” attribute2=”…”>< /SELECT>

    Creates a drop-down list of items. The list items are defined by the OPTION tags placed inside the opening and closing SELECT tag.

      Attributes:

    1. MULTIPLE–Specifies that multiple items may be selected.
    2. NAME=”…”–Specifies the name of the list(Part of the NAME/VALUE pair).
    3. SIZE=”…”–Specifies how many items should be visible.

      <OPTION value=”…”>item

      Specifies an item in the drop down list. Placed within the opening and closing SELECT tags. Any text following the OPTION tag is what the user will see in the list.


      1. VALUE=”…”–Specifies the value to be returned (Part of the NAME/VALUE pair).
      2. SELECTED–This item will already be highlighted when the page loads.




  • <TEXTAREA attribute1=”…” attribute2=”…”>…< /TEXTAREA>

    Creates a multi-lined text entry box. Any text placed in between the tags is used as the default text string that is displayed when the page is loaded.

      Attributes:

    1. COLS=”…”–Specifies how wide the text box will be.
    2. ROWS=”…”–Specifies how high the text box will be.
    3. NAME=”…”–Specifies the name of the text box for use by the program that is processing the form.
    4. WRAP=”…”–Specifies how text will wrap. Possible values are “HARD”, “SOFT”, or “NONE”.


TOP |
BASIC STRUCTURE |
MULTIMEDIA |
LINKS |
LISTS |
FRAMES |
TABLES |
FORMS |
STYLE |
GENERAL FORMATTING |
BOTTOM

Style Sheets:


    Style Sheets are a new way to easily and effectively customize web pages in ways that were not possible before.
    You will be able to specify margins, indents, font faces, and other features to gain control over the exact
    presentation of your document.



    Style Sheet, as designed by the World Wide Web Consortium, are new to HTML and so far only supported be Microsoft’s
    Internet Explorer 3.0. However, Netscape and other browsers will definitely support these new
    elements in future releases so it is a good idea to get started on using Style Sheets now.



    There are three ways to add style to your documents: Linking to a style sheet, Adding a style
    block, or using inline style attributes. In fact, you can use all three if you like. If there is
    a conflict, the browser will use the most recent style definitions for that occurrence.



  • Linking to a Style Sheet

    You can create a separate text file with a .css file extension and place all your
    style definitions (explained below) in that file. Then, using the LINK tag, you can
    link the style definitions to your current document.

    Using this method, you can have one style sheet for the entire site that is linked to
    each page. That way you can alter the look of all your documents be simply editing the
    .css file. See syntax below.



    Inside the HEAD tag, add something like this:

    <LINK REL=STYLESHEET HREF=”URL of style sheet” TYPE=”text/css” >



    Your Style Sheet might contain something like this:

    H1 {font-size: 20pt; font-weight: bold}

    H2 {font-size: 16pt; font-weight: bold}

    P {margin-left: -20px; margin-right: -20px; margin-top: 30px}

    BODY {background: URL(http://my.server.com/pictures/back.gif); text-indent: 2cm}



  • Adding a Style Block

    To set the style for an entire page, you can place all the style definitions (explained below) inside
    the <STYLE>…..< /STYLE> tag. This tag goes inside
    the HEAD of your document. Make sure to enclose the definitions within comment tags
    so that older browsers do not display them. See example below.



    <HEAD>

    .

    .

    <STYLE TYPE=”text/css” >

    <!–

    BODY {font-family: Arial; font-size: 12pt; font-style: italic}

    P {margin-left: 30px; margin-right: 30px; margin-top: 10px}

    –>

    < /STYLE>

    < /HEAD>



  • Inline Style Attributes

    If you simply want to change the style of a particular section of your document, you can
    do so with the STYLE attribute. You can place this new attribute inside just about any HTML
    tag, and the style definitions will be in effect until the closing of that tag.
    Below are some examples.



    To change the color and indent of a certain paragraph, you could do the following:

    <P STYLE=”margin-left: 1in; margin-right: 1in; color: #0000FF”>

    This text would be indented and blue.

    < /P>



    To change the style for an entire portion of your document, you might do the following:

    <DIV STYLE=”margin-left: 0.5in; margin-right: 0.5in; font-family: Arial”>

    This whole division of the page will be indented and any text will be displayed in the Arial font.

    < /DIV>



  • Style Definitions

    All three methods of adding style to a document use the same syntax for style definitions.
    Except for inline attributes, a style definition consists of a tag followed by a list of
    specifications enclosed in curly braces. You can define styles for any tag in HTML. Once
    you have specified styles for a certain tag, every time the tag is used, the styling will be in effect.
    Below is a list of all the style definitions and their possible values.




    1. background –&nbspSpecifies a background color or image.


      • Values:  URL|RGB triplet
      • Example:  BODY {background: #FFFFFF}

    2. color –&nbspSpecifies the color of the text.


      • Values:  RGB triplet
      • Example:  H4 {color: #000000}

    3. font-family –&nbspSpecifies the typeface.


      • Values:  typeface name or list of names
      • Example:  P {font-family: Arial, Helvetica, “Courier New”}

    4. font-size –&nbspSpecifies the size of the text.


      • Values:  pt (points)|in (inches)|cm (centimeters)|px (pixels)|% (percentage)
      • Example:  A:visited {font-size: 14pt}

    5. font-style –&nbspSpecifies the style of the text.


      • Values:  italic|normal|oblique|small caps
      • Example:  H3 {font-style: italic}

    6. font-weight –&nbspSpecifies the thickness of the text.


      • Values:  extra-light|light|demi-light|medium|demi-bold|extra-bold
      • Example:  H2 {font-weight: bold}

    7. line-height –&nbspSpecifies the distance between lines.


      • Values:  pt (points)|in (inches)|cm (centimeters)|px (pixels)|% (percentage)
      • Example:  DIV {line-height: 20pt}

    8. margin-left –&nbspSpecifies the left margin.


      • Values:  pt (points)|in (inches)|cm (centimeters)|px (pixels)
      • Example:  BODY {margin-left: 3cm}

    9. margin-right –&nbspSpecifies the right margin.


      • Values:  pt (points)|in (inches)|cm (centimeters)|px (pixels)
      • Example:  BODY {margin-right: -0.5in}

    10. margin-top –&nbspSpecifies the top margin.


      • Values:  pt (points)|in (inches)|cm (centimeters)|px (pixels)
      • Example:  BODY {margin-top: 20px}

    11. text-align –&nbspSpecifies the justification of the text.


      • Values:  left|center|right
      • Example:  H1 {text-align: center}

    12. text-decoration –&nbspSpecifies certain text effects.


      • Values:  none|italic|underline|line-through|overline|blink
      • Example:  A:link {text-decoration: none}

    13. text-indent –&nbspSpecifies the text indentation.


      • Values:  pt (points)|in (inches)|cm (centimeters)|px (pixels)
      • Example:  P {text-indent: 0.5in}



  • Additional Options


    1. Grouping

      Certain style definitions can be grouped together in one statement. Instead of using
      three statements to specify all three margins, you could use the following:

      P {margin: 20px 3cm 3cm}

      The order is top, right, and left.



      You can also group all the font statements together like this:

      A:active {font: bold italic 15pt/22pt Arial, serif}

      The weight and style must be specified first, and the first number represents the size,
      while the second number represents the line height.
    2. Classes

      You can also define more than one instance of a tag. For example, say you wanted two
      H1 headings; one that was red and one that was blue. You could define the two tags
      like this:

      H1.redh {color: #FF0000; font-size: 20pt}

      H1.blueh{color: #0000FF; font-size:20pt}

      Later you could use them like this:

      <H1 CLASS=redh>This will be red< /H1>

      <H1 CLASS=blueh>This will be blue< /H1>



TOP |
BASIC STRUCTURE |
MULTIMEDIA |
LINKS |
LISTS |
FRAMES |
TABLES |
FORMS |
STYLE |
GENERAL FORMATTING |
BOTTOM

General Formatting:


  • <ADDRESS>…..< /ADDRESS>

    Encloses the signature file of the author of the page. Text is displayed in italics.




  • <B>…< /B>

    Boldfaces the enclosed text.



  • <BIG>…< /BIG>

    Makes the enclosed text one size larger.



  • <BLINK>…..< /BLINK>

    Makes the enclosed text blink continually.




  • <BLOCKQUOTE>…..< /BLOCKQUOTE>

    Encloses a long quote. Both the left and right margins are indented.




  • <BR>

    Inserts a line break.


      Attributes:

    1. CLEAR=”…”–Causes the text to stop flowing around any images.

      Possible values are RIGHT, LEFT, or ALL.


  • <CENTER>…..< /CENTER>

    Centers the enclosed elements. This tag will center everything including images, text, tables, forms, etc.




  • <CITE>…..< /CITE>

    Encloses a citation such as the title of a book or paper.




  • <CODE>…..< /CODE>

    Encloses a sample of code. The text is rendered in small font.




  • <COMMENT>…..< /COMMENT>

    Encloses a comment. Text inside the tags is ignored unless it contains HTML code.




  • <DFN>…..< /DFN>

    Encloses a definition. Text inside the tags is formatted to look like a definition.



  • <DIV ALIGN=”>…< /DIV>

    Specifies the alignment of the enclosed elements. Can be used to divide a document
    into sections that are aligned differently. In future browsers, more attributes will
    probably be supported.

      Attributes:

    1. ALIGN=”…”–Sets the alignment of the division. Possible values are “center”, “right”, or “left”.


  • <EM>…< /EM>

    Emphasis on the enclosed text (Italics).



  • <FONT attribute=”>…< /FONT>

    Sets the font properties for the enclosed text.

      Attributes:

    1. 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 .
    2. COLOR=”…”–Specifies the color of the font.
    3. FACE=”…”–Specifies the face of the font. A list can be defined (separated by commas) and
      the browser will use the first one available on that computer.


  • <HR attribute1=”…” attribute2=”…”>

    Inserts a horizontal line.

      Attributes:

    1. SIZE=”…”–Specifies the thickness of the line.
    2. COLOR=”…”–Specifies the color of the line.(IE)
    3. WIDTH=”…”–Specifies the length of the line as a percentage of the screen. e.g. WIDTH=90% .
    4. ALIGN=”…”–Specifies the alignment of the line: RIGHT, LEFT, or CENTER.
    5. NOSHADE–The line is drawn solid.


  • <I>…< /I>

    The enclosed text is italics.



  • <KBD>…< /KBD>

    Specifies text to be entered at the keyboard. Text is rendered as bold and fixed-width.



  • <LISTING>…..< /LISTING>

    Displays text in fixed-width type. Obsolete — use the PRE tag instead.




  • <MULTICOL>…..< /MULTICOL>

    Displays text in columns.

      Attributes:

    1. COLS=”…”–Specifies the number of columns to use.
    2. GUTTER=”…”–Specifies the number of pixels between each column.
    3. WIDTH=”…”– Specifies the width of the columns as a whole.


  • <NOBR>…..< /NOBR>

    Causes the enclosed text to not wrap to fit the screen.




  • <P attribute>…< /P>

    Designates the enclosed text as a plain paragraph. The end tag is optional.

      Attributes:

    1. ALIGN=”…”–Specifies the alignment for the paragraph. Possible values are “center”, “left”, or “right”.


  • <PLAINTEXT>…..< /PLAINTEXT>

    Displays text in fixed-width type without processing most HTML tags.
    Obsolete — use the PRE tag instead.




  • <PRE>…..< /PRE>

    Displays text in fixed-width type without collapsing spaces.




  • <S>…..< /S>

    Displays text with a line through it. The <STRIKE> tag does exactly the same.



  • <SAMP>…< /SAMP>

    Indicates sample output from a form or program. Text is rendered in small font.



  • <SMALL>…< /SMALL>

    Makes the enclosed text one size smaller.


  • <SPACER attribute>…< /SPACER>(Netscape)

    Inserts blocks of spaces into HTML documents.

      Attributes:

    1. ALIGN=”…”–When TYPE=BLOCK, this specifies the alignment of the surrounding text.

        Values:

      1. RIGHT or LEFT–Aligns the block of space to the specified side of the page, and all text is wrapped around the block.
      2. TOP, MIDDLE, BOTTOM, TEXTTOP, ABSMIDDLE, BASELINE, and ABSBOTTOM–Specifies the vertical alignment of the block of space with other items on the same line.



    2. HEIGHT=”…”–When TYPE=BLOCK, this specifies the height of the block.
    3. SIZE=”…”–When TYPE=HORIZONTAL, or VERTICAL, this specifies the size of the space.
    4. TYPE=”…”–Specifies the type of space being inserted.

        Values:

      1. HORIZONTAL–Inserts blank spaces between words.
      2. VERTICAL–Inserts spaces between two lines.
      3. BLOCK–Inserts a rectangular block of space, much like the IMG tag.



    5. WIDTH=”…”–When TYPE=BLOCK, this specifies the width of the block.

  • <STRONG>…< /STRONG>

    Stronger emphasis on the enclosed text (bold).



  • <SUB>…< /SUB>

    Renders the enclosed text in subscript.



  • <SUP>…< /SUP>

    Renders the enclosed text in superscript.



  • <TT>…< /TT>

    The enclosed text is typewriter font.



  • <U>…< /U>

    The enclosed text in underlined. Try to avoid this since underlined text usually indicates a link.



  • <VAR>…< /VAR>

    Specifies a variable. Text is rendered in small fixed-width type.



  • <WBR>

    Causes text enclosed by the NOBR tags to wrap only if necessary.



  • <XMP>…< /XMP>

    Causes enclosed text to be displayed by the browser without processing most HTML tags.
    Obsolete — use the PRE tag instead.


TOP |
BASIC STRUCTURE |
MULTIMEDIA |
LINKS |
LISTS |
FRAMES |
TABLES |
FORMS |
STYLE |
GENERAL FORMATTING |
BOTTOM






Enhanced for Netscape 3.0 and IE 3.0

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Popular Articles

Featured