|
Below are the tags available in HTML v3.2. Click a link to jump to the full description of the tag.
Character Elements/Markups
|
Examples: | This text is <B>bold</B>.<BR> This text has <I>italic</I> rendering.<BR> |
Rendered as: | This text is bold. This text has italic rendering. |
The character elements can also be used in nestings, but the way they are rendered is dependent on how pedantic the web browser is with the tags. Properly implemented, the following text will be rendered in bold italic: This is a <B><I>bold italic</I></B> text. The following elements can also be used as character rendering tags or markups.
Possible elements inside tags: ISO Latin-1 characters, character
markups, A, BR, IMG.
Can be inside: A, character markups,
ADDRESS, Hn, P, PRE, DD, DT,
LI
Click here to return to the top.
Tag Specifications |
First Implemented In |
|
Netscape Navigator | Internet Explorer | |
<!--...--> | All versions | All versions |
The COMMENT TAGS enable you to add information into your HTML script without it being displayed on screen or printed out from the browser. You can type as many lines as you require between the tags.
E.g.
<!-- Whatever I type in here will not be displayed
on a Web browser -->
Click here to return to the top.
Tag Specifications |
First Implemented In |
|
Netscape Navigator | Internet Explorer | |
<!DOCTYPE> | All versions | All versions |
The DOCUMENT TYPE tag is used to define the HTML standard in your web page. It allows you to formally declare the HTML version within your document. It is the first line in your HTML text and it is also known as the "public text identifier". The following are the tags for the different versions of HTML:
HTML 2.0 allows you to define how strictly the HTML version must be followed. You can use these tags:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML
Strict Level 1//EN">
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict Level
1//EN">
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML Strict Level 2//EN">
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict Level
2//EN">
The document type specifications are formalities, ideally you should be using them. As your HTML expertise increases it is a good habit to add these tags. When the web browsers and search engines become very sophisticated, document types will begin to play a role in the way HTML pages are displayed and catalogued.
More definitions and specifications:
Level 2:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML Level
2//EN">
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Level 2//EN">
Strict Level 2:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML
Strict//EN">
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict//EN">
Click here to return to the top.
Tag Specifications |
First Implemented In |
|
Netscape Navigator | Internet Explorer | |
<A | All versions | All versions |
CLASS=name | N.A. | N.A. |
HREF=url | All versions | All versions |
ID=name | N.A. | N.A. |
LANG=ISO language | N.A. | N.A. |
NAME=name | All versions | All versions |
TARGET=name | Version 2.0 | Version 3.0 |
TITLE=name | N.A. | Version 3.0 |
REL=relationship | N.A. | Version 3.0 |
REV=reverse relationship | N.A. | Version 3.0 |
...</A> |
A hypertext link is defined within the anchor tags <A>...</A>. The attributes that allow linking are the HREF and NAME. Anchor elements with the HREF attribute can contain text or images within the tag structure. These images or text become the label for the jump or link. The labels in a HTML script are usually rendered in a different way to the normal text (usually in a blue color) and thus indicate to the viewer of the document that a jump can be made by clicking on the text with a mouse. Clearly, when a page is designed it is expected that the label is indicative of the place it will jump to.
The HREF attribute must be defined with a name or a URL. This name or URL will tell the web browser where to jump. The NAME attribute of an anchor element will define the place in the document to jump to, so this becomes the target of a jump. In a large document, it is useful when a person is navigating through the areas of interest. It saves time and ensures that the relevant sections are not overlooked.
The same target capabilities are given to the ID attribute. The ID attribute is somewhat more flexible, in that it can be attributed to many more elements. This is a HTML 3 feature that is designed to supersede the NAME attribute.
<A HREF="http://domain.site.edu/information/"> INFORMATION </A>
In this anchor script, the INFORMATION text will be the only visible page marker. It is usually rendered in blue color text. Once it is clicked on or selected by a mouse, the browser will jump to the location indicated by the HREF (i.e. http://domain.site.edu/information).
<A NAME="molecule" >
this metallic structure </A>
The unique structure of a <A HREF="#molecule"> titanium
molecule</A>
In this example, an anchor destination has been established using the NAME attribute. The name or fragment identifier is called "molecule", and for logical reasons the name must only be assigned once per destination. Whenever a HREF anchor wants to link to this area in the document, it must use the '#' character; i.e. <A HREF="molecule"> ................ </A>.
In the above example, the words "titanium molecule" would be rendered in a different color and script to the surrounding text, so a document user will know that it links to another place. The anchor element is ideal for referring to a related reference within a large document.
To see a real working example of this, view the source of this page. The NAME attribute is used to create hyperlinks to different points on the page (also referred to as bookmarks).
<A HREF="http://domain.site.edu/info/atoms.html#molecule"> INFORMATION</A>
In the previous examples a reference was made with an anchor HREF to a section in the same document identified by the "molecule" anchor NAME. If the relevant information was actually on a HTML document in a site half way around the globe, we could still jump to it seamlessly (albeit slightly slower). We do this by still invoking the anchor HREF but instead of using a local URL (uniform resource locator), we call up a URL that jumps to a server domain site in another place (i.e. http://domain.site.edu/information/). This URL describes the server domain name and type. It also points to a directory called /information/. In that directory, a HTML script file called "atoms.html" can be found. This information is enough to bring up the document, but the #molecule extension placed directly behind the document name actually brings up the relevant section of the document that has the anchor NAME "molecule".
ATTRIBUTES
CLASS=name
This attribute is used to classify the anchor tag. The classification
names are selected to be logical and reflect the content. Some programs
search these classes to find relevant information in large collections of
documents.
ID=name
This attribute sets an identification name (which must be unique within the
document) for the information contained within the anchor. The name can
then be used as a hypertext link target or in conjunction with style sheets for
formatting HTML.
LANG=ISO language
This attribute allows you to assign a language standard for the information
contained between the DIV tags.
HREF=URL
This attribute gives the URL of the document or file that the hypertext link
will go to. When no path name is specified, the HREF is assumed to be
relative to the currently open document.
TARGET=window
This attribute is used to load a page that is accessed by the anchor into a
targeted window. If the window does not exist, it will load a new browser
window. It is also used with frames to load the page that is accessed by
the anchor into a named target window. There are some target window names
that are reserved for special uses, these include:
_blank | This will load a link into a new window. |
_parent | This will load a link into the immediate parent. |
_self | This will load a link into the current window in which the hypertext link was selected. |
_top | This loads a link over the top of existing windows and into the full browser window. |
TITLE=name
This attribute is used to describe the link that is being accessed. A
title will appear in the browser status bar or just under the mouse cursor.
REL=relationship
This attribute is used to specify a relative relationship with the document
that is being accessed with the hypertext link.
REV=reverse relationship
This defines a reverse relationship between the current document and the
document that is being accessed via the anchor and hypertext link.
Possible elements inside tags: ISO Latin-1 characters, character
markups, BR, IMG
Can be inside: ADDRESS, Hn, P, PRE, DT, DD,
LI, character markups
Click here to return to the top.
Tag Specifications |
First Implemented In |
|
Netscape Navigator | Internet Explorer | |
<ADDRESS> ...</ADDRESS> |
All versions | All versions |
Details:
The ADDRESS element is placed around the address of an author, person or place. Its main task is to provide a logical HTML marker for a contact address. It is usually placed at the top or bottom of the page. Most browsers will render the contents of the ADDRESS tags in italics, and in many cases, the contents of the ADDRESS tags are used as hypertext jumps to the address itself.
Possible elements inside tags: ISO Latin-1 characters, character
markups, A, BR, IMG
Can be inside: BLOCKQUOTE, BODY, FORM
Click here to return to the top.
Tag Specifications |
First Implemented In |
|
Netscape Navigator | Internet Explorer | |
<APPLET | Version 2.0 | Version 3.0 |
ALT="string" | Version 2.0 | Version 3.0 |
ALIGN=type | Version 2.0 | Version 3.0 |
CODE="file" | Version 2.0 | Version 3.0 |
CODEBASE="codebase url" | Version 2.0 | Version 3.0 |
HEIGHT=n | Version 2.0 | Version 3.0 |
WIDTH=n | Version 2.0 | Version 3.0 |
HSPACE=n | Version 2.0 | Version 3.0 |
VSPACE=n | Version 2.0 | Version 3.0 |
...</APPLET> |
The APPLET element is used to allow the embedding of a Java application into a HTML document. The APPLET element along with the associated PARAM elements pass the required values to the Java application. A browser that is able to run Java applets will detect the tags and load the applet into the page. It will load all the required information for the applet up to the last PARAM element. The information after this is used to give browsers that do not run Java a set of alternative instructions and messages. Browsers that are Java compatible will ignore this extra HTML code. The following are attributes that the APPLET element can contain.
CODE="file"
This is the name of the file that contains the compiled applet
subclass. It is relative to the base URL (i.e., it should be saved in the
same directory as the HTML page that calls it). You can not specify an
external URL in this attribute.
CODEBASE="codebase URL"
This attribute allows you to specify the URL where the applet resides.
You can also use notation to specify the applet directory relative to the
current document URL. If this attribute is not specified, the URL will
default to the current document's URL.
ALT="string"
This provides browsers that cannot run Java applications a text message to
display. Clearly, the browser should know that it is reading in an APPLET
element and be able to display the text string.
NAME="applet_instance"
This specifies a name for the applet instance. In effect, other
applets on the same page are able to communicate (if they are set up to do so).
ALIGN="alignment"
This attribute sets the alignment of the applet display area. Some of
the values you can specify include: MIDDLE, LEFT, RIGHT, BOTTOM, TOP,
TEXTTOP, ABSMIDDLE, ABSBOTTOM and BASELINE.
VSPACE="pixels" HSPACE="pixels"
This attribute allows you to specify an invisible border around the
applet. In this border, nothing can be written, drawn or displayed.
The VSPACE (vertical space) specifies the number of pixels above and below the
applet. The HSPACE (horizontal space) specifies the number of pixels to
the left and right of the applet.
This is a very simple example of a Java applet without any parameters to pass:
<applet CODE="Strobe.class" WIDTH=150 HEIGHT=1500>
Java applet that creates a disco strobe that fills the page. </applet>
The PARAM element is placed within the APPLET tags and is used to pass parameters to the applet. They are specified as name/value pairs. The details of the names to use and the range of values you can define are generally given or explained by the author of the Java applet.
<PARAM NAME=Parameter VALUE="value">
Here is another example using PARAM elements (a lot of them):
<applet CODE="Flag.class" WIDTH=180
HEIGHT=95>
<param NAME=res VALUE="5">
<param NAME=backR VALUE="100">
<param NAME=backG VALUE="0">
<param NAME=backB VALUE="6">
<param NAME=pattern VALUE="4">
<param NAME=speed VALUE="34">
<param NAME=curve VALUE="3">
<param NAME=wind VALUE="45">
<param NAME=nation VALUE="2">
Your browser doesn't support Java.
</applet>
Click here to return to the top.
Tag Specifications |
First Implemented In |
|
Netscape Navigator | Internet Explorer | |
<BASE | All versions | All versions |
HREF=url | All versions | All versions |
TARGET=window> | Version 2.0 | Version 3.0 |
The BASE element is ideal for when a document has been moved from its original URL, but the related images, files and links have not. By using the BASE tag you can load a HTML document from any site or URL and access all the related files used by the HTML page from the original URL. If the BASE address is not specified, the browser will automatically use the URL where the page is loaded to access all the related files
Example:
The original URL of a HTML page is http://www.somesite.com/Main.
A person would like to move it to http://www.html.com/coollinks
but does not have the space for all the images and files. All they need to
do is access the HTML document on http://www.html.com/coollinks
and place the following BASE tag in the Head
of the document.
<HEAD>
<TITLE>Somesite.com</TITLE>
<BASE HREF="http://www.somesite.com/Main">
</HEAD>
ATTRIBUTES
HREF="URL"
THe full URL specification of the documents home, so no matter where the
HTML document is loaded from, it will still be able to access the images, links
and files.
TARGET="window"
The TARGET attribute allows you to
specify a window name (usually specified in a FRAMES
set up) to load any of the links on the page into. So when you load a
document with the BASE tag and TARGET
attribute set and you click on a link, the following will occur:
The following BASE tag will load any links found on the somesite.html page into the window named section1.
<HEAD>
<TITLE>Somesite Features</TITLE>
<BASE HREF="http://www.somesite.com/Main/somesite.html"
TARGET="section1">
</HEAD>
TARGET="preset calls"
The TARGET attribute has some preset
options to load links into windows. These include:
TARGET="_blank"
This will load a link document into a new window that does not have any
particular name.
TARGET="_parent"
This attribute will load a link document into the immediate parent of the
current document.
TARGET="_self"
This attribute will load a link document into the window that it was called
from.
TARGET="_top"
This attribute will load a link document into the full window of the
browser, i.e. replace all the frame pages, etc.
Click here to return to the top.
Tag Specifications |
First Implemented In |
|
Netscape Navigator | Internet Explorer | |
<BASEFONT | Version 1.1 | Version 3.0 |
COLOR=color | N.A. | Version 3.0 |
SIZE=n | Version 1.1 | Version 3.0 |
NAME=name> | N.A. | Version 3.0 |