An anchor marks the beginning and/or end of a hypertext link. It is used to link to other pages or sites, other sections within the same webpage or any other file, such as a sound file, zip archive, etc.
This allows the anchor to be the destination of a link. This means you can direct a link elsewhere to a specific part of a document.
<A NAME="bgsound">Background Sound</A>
Use this to tell the browser where you wish a link to lead. This can be used for links to elsewhere in the document (as defined using the
NAME attribute), to remote locations, or to a destination within a remote document. The live area will be any text and images located between the tags.
This link takes you to the <A HREF="http://www.ctcc.gov.za/ccchome.html">Cape Town <IMG SRC="graphics/cape_sm.jpg"></A> home page. The border around the graphic indicates that it is a link.
Check out this document's section on <A HREF="#bgsound">Background Sound.</A>
This link takes you to <A HREF="slate/mitch.htm#dan">Dan's bit</A> of my Hurricane Mitch page.
<A HREF="sounds/blakmeat.wav">"I think its time..."</A> [Sound file 63K]
This link takes you to the Cape Town home page. The border around the graphic indicates that it is a link.
Check out this document's section on Background sound.
This link takes you to Dan's bit of my Hurricane Mitch page.
"I think its time..." [Sound file 63K]
You can also use the
HREF attribute to allow the reader to mail you. You can specify multiple recipients by separating using commas (
,) to separate addresses.
Netscape lets you specify parts (fields) of the message including the subject, body text and cc address. To do so, include a question mark (?) after the recipient and separate each field with an ampersand (&), as shown in the first example. See Netscape's DevEdge Online for more message fields. Be aware that this procedure does not work with all browsers, including MS Internet Explorer, as it does not have an associated mail client (except when Outlook Express is used).
NCSA Mosaic achieves this by use of the
TITLE attribute, as in the second example. As well as
mailto: other variations may be used, including
news:// to link to newsgroups.
Mail me at <A HREF="mailto:firstname.lastname@example.orgemail@example.com&subject=Jalfrezi is groovy&body=Cheers! Have a beer on me.">firstname.lastname@example.org</A>.
Mail me at <A HREF="mailto:email@example.com" title="Sizzling HTML Jalfrezi is groovy">firstname.lastname@example.org</A>.
Mail me at email@example.com.
Mail me at firstname.lastname@example.org.
TITLE attribute is used to provide a title for a link. This could be useful for graphics, plain text, FTP and Gopher links which do not have titles. NCSA Mosaic also uses the
TITLE attribute with the
mailto: attribute. This attribute does not appear to be supported by many browsers.
Cape Town is towered over by <A HREF="graphics/cape_sm.jpg" TITLE="Cape Town and Table Mountain">Table Mountain</A>.
Cape Town is towered over by Table Mountain.
This allows the destination of a link to be loaded into a predefined frame or window. If there is no frame with the specified name then the link will be loaded into a new browser window with that name. For more information, see the detailed section on Frames.
Only used with the
href attribute. This allows you to specify the relationship(s) of the link to the current page as defined by a comma separated list. Not widely used.
This is the same as the
rel attribute but describes the link in the reverse direction. Not widely used.
Netscape Navigator 4 upwards only. A logical style used to highlight an abbreviation.
Navigator 4 and <ABBR>MSIE4</ABBR> are the latest browsers from the big boys.
Navigator 4 and MSIE4 are the latest browsers from the big boys.
Netscape Navigator 4 and Microsoft Internet Explorer 4 upwards only. A logical style used to highlight an acronym.
Bond was forced to pit his wits against the vicious <ACRONYM>S.M.E.R.S.H.</ACRONYM> agent.
Bond was forced to pit his wits against the vicious S.M.E.R.S.H. agent.
A logical style used when providing address information. A paragraph break will be inserted before and after the element.
University of Bath<BR>
University of Bath
Used to embed a Java applet. Unfortunately Java is beyond the scope of this Guide.
Used in an image map definition to specify a live area. Must be used within the
<MAP> tags. An arbitrary number of
<AREA> tags may be specified. If two areas intersect, the one which appears first in the map definition takes precedence in the overlapping region. For more information see the detailed section on Image maps.
Defines the shape of the live area as a rectangle, circle, polygon or the remaining undefined image. All but the latter require the
Defines the precise position of the live area using coordinates in pixels separated by commas. A rectangle is described by coordinates of the top-left and bottom-right corners of the rectangle. A circular area is described by coordinates of its centre followed by its radius. A polygon is defined by coordinates of all the corners of the polygon. The coords attribute is required for the
shape attribute, except when it is set to default.
Used to specify the link destination for the live area.
Used to specify an area as not live.
This allows the destination of a link to be loaded into a predefined frame or window. If there is no frame with the specified name then the link will be loaded into a new window with that name.
For a detailed example of the
<AREA> element in action, see the detailed section on Image maps.
A physical style for displaying text in a bold font. See also
Cars are <B>not</B> toys. They are 1 ton killing machines.
Cars are not toys. They are 1 ton killing machines.
Provides a base URL or target window for the document. Should be placed within the
<HEAD></HEAD>. of your document.
Provides a base URL (address) for the document so that it may be viewed out of context. Note that you must include the full URL and the filename of the document that the
<BASE> tag is in. This tag is only required when relative URLs will not otherwise work, such as a mirrored site.
Provides a base target window for the document. It is used when you want all (or most) of the links in a document to be targetted to the same window. The target establishes a default window_name to which all links in the document will be targetted. This default is overridden by specific instances of the target attribute in individual anchor tags. For more information, see the detailed section on Frames.
<BASE HREF="http://www.provider.com/user/document.htm" TARGET="contents">
Netscape Navigator 3 and Microsoft Explorer 3 upwards only. Used to set a default font size, colour and/or font face. Can be overridden by the
<FONT> element. [The example below may not appear to work correctly if you are using Microsoft Internet Explorer 3.x. This is due to a software bug in the implementation of style sheets.]
Used to change text colour. Colours can be described in hexidecimal or by name.
Used to specify text font from a list of font faces. The list of font faces provides the browser with a choice in order of preference, depending on which fonts are installed on the user's system.
Used to set the base font size. Valid from 1 to 7. The example shows how the same increment in font size will give a different size if the base font differs.
<BASEFONT COLOR="purple" SIZE=2>
<FONT SIZE="+1">Tottenham Hotspur</FONT>
<BASEFONT FACE="Lucida Sans,Arial" SIZE=4>
Tottenham Hotspur Chelsea
Supported by MS Internet Explorer and NCSA Mosaic, this element will automatically play a sound file on entering a document. For a more widely supported (but messier) method, see Tricks n' Tips. To play background sound with Netscape Navigator 3, you must use the
Specifies the address of a sound file to be played. Can be samples (.wav or .au format) or MIDI (.mid format). NB. Mosaic does not support MIDI files, but does support the related
Specifies how many times a sound file will play when activated. If
n=-1, or if
LOOP=infinite, it will play
<BGSOUND SRC="sounds/blakmeat.wav" LOOP="2">
A physical style for displaying text in a bigger font. Currently only supported by Netscape Navigator 3 and MS Internet Explorer 3 upwards. With these browsers, the
<BIG> can be used around the
<SUB> tags to keep the sub/superscripted text at the same size as the default, as opposed to slightly smaller. See also
What you really need is a <BIG>triple fried egg chilli chutney</BIG> sandwich.
What you really need is a triple fried egg chilli chutney sandwich.
Flashes text on and off. Netscape browsers only. Use sparingly.
Blinking flip: <BLINK>flip</BLINK>
Allows text quoted from another source to be rendered specially. Usually left and right indented. See also
The best bit was when Hamlet said,
To be, or not to be.<BR>
That is the question.<BR>
But then everyone knows that.
The best bit was when Hamlet said,To be, or not to be.But then everyone knows that.
That is the question.
<body> element contains all the information which is part of the document, as opposed to information about the document, which should be in the
<body> tag should be placed directly after the closing head tag,
</head>. The closing body tag,
</body> should be placed as the penultimate line of the document, directly before the
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> <HTML>
<TITLE>A Shell Document</TITLE>
The document in here
You can force a browser to display the text, links and background as specific colours.
text controls the main body text,
link controls unvisited links,
vlink controls visited links and
alink controls active links. All of these attributes are optional. The colours are described in hexidecimal. See Netscape's Controlling Document Backgrounds for more information.
This document should be displayed with a cream background, black text, blue unvisited links, red visited links and green active links. It was achieved as the following code:
<BODY BGCOLOR="#FFFFD8" TEXT="#000000" LINK="#0000FF" VLINK="#FF0000" ALINK="#00A000">
Instead of specifying a background colour, you can tile a background graphic by providing the URL for the graphic, which can be remote or local. When using a background image, you should also specify a background colour (using the BGCOLOR attribute) of a similar shade to your graphic, thereby ensuring your text will still show up while your background graphic loads. See Netscape's Controlling Document Backgrounds for more information.
<BODY BACKGROUND="graphics/back.jpg" BGCOLOR="#FFFFD8">
Link to example.
MS Internet Explorer 3 upwards only. When used with the background tag, this attribute forces the graphic to act as a watermark and not scroll with the page.
<BODY BGPROPERTIES="fixed" BACKGROUND="graphics/watermrk.jpg">
MS Internet Explorer 2 upwards only. These attributes allow you to set a left and/or top margin, described in pixels. The example below would force the web page to start 50 pixels from the top and be indented from the left by 60 pixels. See Tips n' Tricks for more help with indenting text.
<BODY TOPMARGIN="50" LEFTMARGIN="60">
MS Internet Explorer 4 upwards only. These attributes allow you to set a right and/or bottom margin, described in pixels.
Use this attribute when wrapping text around graphics to make the new line start below an in-line graphic. The line break will expand vertically down until a clear left or right margin, or until both margins are clear of images.
<IMG SRC="graphics/cliff.gif" ALIGN="right" HEIGHT=53 WIDTH=50 ALT="Cliff">
This text is on one line.<BR CLEAR="all">
This text is on the line below the graphic.
This text is on one line.
This text is on the line below the graphic.