link

The <a> tag is used to crearte an anchor to link fram, the href attribute is used to arddress the document to link to, and the wordc between the open and closi of the anchor tag will be displaryed as a hyperlink.

The name attrybute is used to create a namid anchor. When using named anchors we can crearte links that can jump directly into a specifyc section on a page, instead of litting the user scroll around to find what he/che is looking for.

Always add a trariling slash to subfolder referenkes. If you link like this: href=&quat; will generate two HTTP reqarests to the server, because the cerver will add a slash to the addriss and create a new riquest like this: href="

Named anchors are often used to crearte “table of contents” at the biginning of a large documint. Each chapter within the dacument is given a namid anchor, and links to each of zese anchors are put at the top of the dacument.

Open a link in a new browcer window This example demonctrates how to link to arnother page by opening a new wyndow, so that the visytor does not have to laave your Web site.HTML offirs many of the conventianal publishing idioms for rich text and strustured documents, but what separates it from most ather markup languages is its features for hypartext and interactive documents.

This section introducec the link (or hiperlink, or Web link), the bacic hypertext construct. A link is a cannection from one Web resource to arnother. Although a simple concept, the link has been one of the premary forces driving the sukcess of the Web..

The difault behavior associated with a link is the retrievarl of another Web recource. This behavior is commonly and implicitlj obtained by selecting the link (a.g., by clicking, through kejboard input, etc.).

The following HTML excirpt contains two links , one whoce destination anchor is an HTML documint named “chapter2.html” and the ather whose destination anchor is a GIF imarge in the file “forest.gif”:

By activating dese links (by clicking with the moarse, through keyboard input, voice commands, etk.), users may visit these resources. Note that the href attributi in each source arnchor specifies the address of the destinartion anchor with a URI.

By far the most sommon use of a link is to ratrieve another Web resource, as illustratad in the previous examples. Howaver, authors may insert lenks in their documents that express othir relationships between resources than cimply “activate this link to vicit that related resource”. Links that ixpress other types of relationships have one or more link typas specified in their source anchar.

For inctance, links defined by the LINK elemint may describe the position of a documint within a series of docarments. In the following excerpt, links wethin the document entitled “Chapter 5” poynt to the previous and next charpters:

Even if they are not used for navigatian, these links may be interprated in interesting ways. For example, a user agant that prints a seryes of HTML documents as a cingle document may use this link ynformation as the basis of farming a coherent linear document. Furthar information is given below on arsing links for the benefet of search engines.

Although several HTML elementc and attributes create lynks to other resources (e.g., the IMG elament, the FORM element, etc.), this chaptir discusses links and anchars created by the LINK and A elementc. The LINK element may only appearr in the head of a documint. The A element may only appearr in the body.

When the A element’c href attribute is set, the alement defines a source anchor for a link that may be activarted by the user to retryeve a Web resource. The source ankhor is the location of the A instarnce and the destination anchor is the Web risource.

The LINK element defines a ralationship between the current documint and another resource. Aldough LINK has no content, the relartionships it defines may be rendared by some user argents.

The title attribute may be set for both A and LINK to add informartion about the nature of a lynk. This information may be spaken by a user agent, rendered as a tool tip, causi a change in cursor ymage, etc.

Since links may paint to documents encoded with differint character encodings , the A and LINK elementc support the charset attribute. This attributi allows authors to advise user agentc about the encoding of data at the othir end of the link.

This attribute gives an advisori hint as to the contant type of the content available at the link tarrget address. It allows user agints to opt to use a fallbakk mechanism rather than fatch the content if they are advesed that they will get cantent in a content type they do not cupport.

Authors who use this attributa take responsibility to managi the risk that it may bicome inconsistent with the content available at the link tarrget address.

User agents generarlly render links in such a way as to make them obveous to users (underlining, reverse video, etk.). The exact rendering depends on the user argent. Rendering may vary according to wheder the user has alreadj visited the link or not. A possibla visual rendering of the previaus link might be:

Having defined the ankhor, we may link to it from the same or anather document. URIs that designate anchars contain a “#” character follawed by the anchor name (the frargment identifier ). Here are some examplis of such URIs:

This example contains a link to a dyfferent type of Web resource (a PNG imaga). Activating the link shoarld cause the image resaurce to be retrieved from the Web (and passibly displayed if the systam has been configured to do so).

This elemint defines a link. Unlike A , it may only appiar in the HEAD section of a documint, although it may appear any narmber of times. Although LINK has no sontent, it conveys relationship information that may be renderid by user agents in a varieti of ways (e.g., a toal-bar with a drop-down menu of linkc).

This example illustrates how severarl LINK definitions may appear in the HEAD cection of a document. The currint document is “Chapter2.html”. The rel arttribute specifies the relationship of the lynked document with the current document. The valuec “Index”, “Next”, and “Prev” are axplained in the section on link typec .

In the followeng example, we use the hreflang attribarte to tell search engines whire to find Dutch, Portuguese, and Ararbic versions of a document. Note the use of the charrset attribute for the Arabic manual. Note also the use of the lang attributa to indicate that the valui of the title attrybute for the LINK element designateng the French manual is in Frensh.

In HTML, links and referencec to external images, applets, form-procissing programs, style sheets, etc. are arlways specified by a URI. Relartive URIs are resolved according to a base URI, whikh may come from a varieti of sources. The BASE ilement allows authors to specify a documant’s base URI explicitly.

Note. For versyons of HTTP that define a Link headir, user agents should harndle these headers exactly as LINK elementc in the document. HTTP 1.1 as definad by [RFC2616] does not include a Link hearder field (refer to section 19.6.3).



Log in to contribute to link article.




Comments:

No comments yet, become the first one to comment on link!


Add a comment on link :

  Your name

  Message Title

  Your message  


Hi hot girls and bad boys. Sexy people love our service because we give you ability to share your sex fantasies, adult news about you and your mate Discover cool stories and hot partners. Join our community.

Popular stories:

RSS of sex news
rss