HTML Hyper(anchor) Links

Web link have two basic components :link and the target,or destination.

  • the link is the tag in the main document(source)that refers to another document
  • the target, or destination,is the document(or particular location in the document)to which the link leads
  • link is create communication one page to another page
  • every web html page have number of anchor link element

<a> anchor element is used to defines link in html document. a link is a connection from one web resource to another.<a> tag href attribute hold the destination web source (e.g. a sound file ,video clip, images,program file ,pdf file) .

html hyperlink(links)

the html <a> tag defines a hyperlink every link have a attribute (href) with url

 <a href="http://www.w3webtutorial.com"  title="link info"  target="_top"> 
 
      click able value put here</a>
      
 <a  href="url"  target="target value"  title="text about the link">like</a>

link Target attribute values

The target attribute specifies where to open the linked document.

valueDescription.
_blank Opens the linked document in a new window.
_self Opens the linked document in the same frame as the link.
_parent Opens the linked document in the parent frameset.
_top Opens the linked document in the main window ,replacing any and all frames present.
_name Opens the linked document in the window with the specified name.
       <a href="./this is relative url" target="_self">click</a>
       
       <a href="http://www.google.com"    target="_blank">click</a>
       
       <a href="http://www.w3webtutorial.com"    target="_top">click</a>

links status modes:

each link in html document have four different status modes.

  • link ___the standard link in the document.it is neither active nor visited(see other modes).
  • Active __the link's target is active .
  • Visited __the link's target has been previously visited
  • Hover __the mouse pointer is over the link.

css color value of each hyper link status :

  • link __blue,underlined text
  • active ___red,underlined text
  • visited ___purple,underlined text
  • hover ___no change in the appearance of the link(remains blue,red,or purple)

html links <a> attributes:

attributevaluedescription
charsetchar_encodingthe character encoding of linked resource.
typeMime_typespecifies mime_type of the linked document.
namecdataspecifies the name of the anchor.
hrefuriuri for linked resource.
hreflanglanguageCodelanguage code.
rellinkRelationTyperelationship between the current document and the linked document.
revlinkrelationTyperelationship between the linked document and the current documnet.
accesskeycharacteraccessibility key character
coordscoordsuse with client-side image map
tabindexnumberposition in tabbing order
target_top,_blank,_parent,_selfposition where open the document