Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


HTML BODY: Hyperlinks or Anchors

An anchor is a piece of text or some other object (for example an image icon) which marks the beginning and/or the end of a hypertext link. A link is a connection from one Web resource to another. Although a simple concept, the link has been one of the primary forces driving the success of the Web. A link has two ends -- called anchors -- and a direction. The link starts at the "source" anchor and points to the "target" anchor, which may be any Web resource (e.g., an image, a video clip, a sound bite, a program, an HTML document, an element within an HTML document, etc.). The text between the opening and closing tags, <A attributes> ...text... </A> can be the source or target (or both) of a link.

An anchor must include a name or href attribute, and may include both.

  • The href attribute declares the supplied URL to be the target of this anchor, i.e. the resource (typically a web page) that will be retrieved if the user clicks on it.
  • The name attribute declares the anchor to be available as a target for links - when used as the href value in an anchor, the browser places this anchor near to the top of the window.
There are several optional attributes, but they are rarely encountered. Don't omit the double quotes around URLs in anchors.
<a href="URL"> . . . </a> Link to another file or resource
<a name="anchor_name"> . . . </a> Define a target location in a document
<a href="#anchor_name"> . . . </a> Link to a location in the same document. A hash means that the link is to a tag internal to the document.
<a href="URL#anchor_name"> . . . </a> Link to a target location in another document
<A HREF="image.jpeg"> <IMG SRC="icon.gif" ALT="some_text"> </A> The image `icon.gif' is a hypertext link to the image file located in the same directory as the currently accessed document (unless otherwise specified by the BASE element).
<a href="mailto:email@isp.com"> . . . </a> Link will invoke a pre-addressed email window.
<a href="mailto:email@isp.com?subject=new email"> . . . </a> Link will invoke a pre-addressed email window with subject "new email"
<a href="URL?string1+string2..."> . . . </a> Send one or more strings to a script. In this example, the URL is a script, the ? is a separator, and the strings are material processed by the script. This format is commonly used for sending frequently-searched-for strings to a search engine.

By default, a link will be underlined and in the color specified by the user's browser for visited and unvisited links. There are a number of ways to specify how a link will appear:

  • Style Sheets allow you to control the appearance of a single link or all links within your site. This is also the only way to remove the underline from a text link.
  • Body tag allows setting the link, active link, and visited link colors for the current page
  • To remove the border around an image link, use the border attribute of the IMG element

W3C: Links in HTML documents



Up to => Home / Authoring / HTML




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers