1.3.2 HTML basic tag-use hyperlinks

Source: Internet
Author: User


Creating hyperlinks) is an important part of the HTML language. The hyperlink tag format is:
<A property = value...> Hyperlink content </A>
Hyperlinks are usually represented in text or images. When you point a hyperlink to a webpage, the pointer turns into a finger. When you click a hyperlink, the browser loads another webpage according to the hyperlink instructions, or jumps to another location in the same webpage or other webpage. The current hyperlink location is called the source endpoint, And the destination to jump to is called the target endpoint.
Based on different destination endpoints, hyperlinks are classified into the following forms:

(1) create a file link
The target endpoint of the file link is a webpage file. The webpage file can be located on the server where the current webpage is located or on another server. In HTML, use the tag to create A hyperlink. common attributes are as follows:
Href = the URL address of the target endpoint can contain one or more parameters)
In a browser, if the file to be linked to is an HTML document, load the document in the current window or other target Windows. For other types of files, the browser loads or saves the target file to the client computer through other applications or plug-ins. This attribute is required.
Target = window or framework name
The target document will be opened in the specified window or framework. If this attribute is omitted, the target document will be opened in the current window. The value of the Target attribute can be either the name of the window or frame, or the following reserved words:
_ Blank: An untitled new browser window.
_ Parent: the parent frame page or window. If the frame containing the link is not nested, the target file of the link is loaded into the entire browser window.
_ Self: In the same frame or window.
_ Top: delete all frames in the browser window.
Title = the Title text displayed when pointing to a hyperlink.
For example:
<A Href = "xp.htm" Target = _ blank> my photo </A>
<A Href = "http://www.jlonline.com"> Jinling Hotline </A>

(2) create an anchor Link
The destination endpoint of the anchor link is a location in the web page. When creating an anchor link, you must set a position to mark the anchor at a location somewhere on the page) and specify a name for the location to reference it on the same page or other pages. The anchor link is usually used to jump to a specific topic part of this page or other pages, so that visitors can quickly reach the desired location. To create an anchor link, first Name the location to jump to on the page, that is, place A tag on the location, and specify A Name for the location through the Name attribute, do not place any text between the <A> and </A> labels. For example, the following settings are used to describe the position of your resume in me.htm:
<P> <A Name = "jl"> my resume: </A> </P>
After creating an anchor, you can use the tag to create A hyperlink pointing to the anchor. For example, to jump to an anchor named "jl" on the same page, you can use the following HTML code:
<P> <A Href = "# jl"> click here to view my resume </A> </P>
To jump to this anchor on another page, use the following HTML code:
<P> <A Href = "me.htm # jl"> my resume </A> </P>

(3) create email links
You can start an email client, such as Outlook or FoxMail, through the email link E-mail link) and allow visitors to send emails to a specified address. Use mark A to create A mail link. The Href attribute of this tag consists of three parts: Part 1 is the email protocol name mailto, and Part 2 is the email address, part 1 is an optional subject in the form of "subject = topic ". Part 1 and part 2 are separated by a colon :), and Part 2 and Part 1 are separated by a question mark ?) Separated. For example:
<A Href = "mailto: me@jlonline.com? Subject = Hello "> <B> here </B> </A> you can send me A mail <Br>
When a visitor clicks a mail link in a browser window, the email client program such as Outlook Express or FoxMail is automatically started, and the specified topic is filled in the "topic" column.


BibliographyPrevious sectionNext section

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.