Pages

Saturday, January 8, 2011

Anchor Element

The anchor element is used to insert a hyperlink that is capable of connecting multiple documents. When anchor element is selected or clicked, the web browser navigates to a different destination in which to where the anchor element is pointing. you may direct the anchor element to other documents, images and even other sections within your document.

The anchor element can also contain images other than text that is displayed on your web browser. Mostly, web browser displays the text in an underlined font style.

Listed below are the most common attributes you can use for the anchor element:
  • class - provides the class or classes of the element. This attribute is used to identify the name of the style class or classes to be used for rendering.
  • href - provides the Uniform Resource Locator (URL) of the target resource which is the address of the document you wish to point.
  • id - provides a unique name for the heading.
  • lang - provides the language in which the enclosed content is coded.
  • style - provides a cascading style sheet (CSS) properties to the heading.
  • title - privides a text title for the heading. Most web browser displays the value of the title as "tooltip".

Here's an example on how to use the anchor <a> element:

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
         <meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
         <mate name="keywords" content="blog, web development" />
         <title>the ANCHOR element</title>
     </head>

     <body>
       <h1>
         the ANCHOR element
       </h1>
          An article from the Wall Street Journal says:
       <p>
            In an effort to promote thoughtful consideration of the sites, voters on the <a href="http://www.new7wonders.com">Web site</a> must submit a ballot with seven votes, not just their national favorite.
        </p>
    </body>
</html>

0 comments:

Post a Comment