eHow launches Android app: Get the best of eHow on the go.

How To

How to Change Link Attributes

Contributor
By eHow Contributing Writer
(0 Ratings)

A link is created in an HTML using the "a" tag. Using a link tag creates an underlined text element that tells the user he can navigate to another web page. The web page can be a local file on the domain or it can send the user to another domain on the Internet. Several link attributes are also available to change the font, color or behavior.

Difficulty: Moderate
Instructions
  1. Step 1

    Create a basic link in the HTML file. The basic structure of a link tag is shown below.
    <a>My link</a>

  2. Step 2

    Setup a navigation location for the link. The "href" attribute is where the user is sent when he clicks on the link on the HTML page.
    <a href="http://www.yourdomain.com/starterpage.htm">My link</a>

  3. Step 3

    Give the link a name. Setting the "name" attribute allows you to call the link from other parts of the page like a Javascript function.
    <a href="http://www.yourdomain.com/starterpage.htm" name="my_link">My link</a>

  4. Step 4

    Set the "title" attribute for mouse_over effects. The mouse_over event is called when the user hovers the mouse over the link. The text that is displayed is set in the "title" attribute.
    <a href="http://www.yourdomain.com/starterpage.htm" name="my_link" title="Click Me!">My link</a>

  5. Step 5

    Configure where the new page is shown. The "target" attribute tells the browser where to open the page. This can be in a new window or within the current window of the browser. The sample below opens the page in a new window. To open the page in the same window use the "_self" setting.
    <a href="http://www.yourdomain.com/starterpage.htm" name="my_link" target="_blank">My link</a>

  6. Step 6

    Change the link color in the body tag. All HTML pages have a body tag at the top of the page. The following code changes the link's color.
    <body link="#000000" vlink="#ff0000">
    The "link" property changes all the page links to black. The "vlink" means "visited link." Once a reader has visited the page in the link tag, "vlink" displays a different color. In this example, the visited link is displayed as red.

References

Subscribe

Post a Comment

Post a Comment

Related Ads

  • Have you done this? Click here to let us know.
I Did This
Get Free Internet Newsletters

Copyright © 1999-2009 eHow, Inc. Use of this web site constitutes acceptance of the eHow Terms of Use and Privacy Policy .   en-US Portions of this page are modifications based on work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License. † requires javascript

Demand Media
eHow_eHow Technology and Electronics