Mark-A with good hyperlinks

Source: Internet
Author: User
Tags add format reference window zip
Link Hyperlinks <a> tags represent a link point, which is shorthand for English anchor (anchor). Its role is to connect the current position of text or pictures to other pages, text or images, which is well-known, but the grammatical structure of it may be a little bit unknown, but to live it must understand its grammatical structure. The basic grammatical structure of the <a> tag is:
<a
Class=type
Id=value
Href=reference
Name=value
Rel=same|next|parent|previous
Rev=value
Target=window
Style=value
Title=title
Onclick=function
Onmouseout=function
Onmouseover=function> </a>
From the grammatical structure of the tag, you can see that when you set up a hyperlink there are many parameters to choose from to achieve different link effect, this is a bit unexpected?!
Where the class and ID options are used to set the type and assigned ID number of the link point, usually not set. The two most commonly used parameters are href and name. where HREF is the acronym for Hypertext Reference, which is used to set the link address. The link address must be a URL address, and if no specific path is given, the default path is the same as the current page's path. The file that you link to is also divided into several cases: if it is an HTML file, open it directly in the current browser If the executable file (. exe file) is executed or downloaded directly, we provide the downloaded file with this feature; If you are a text file such as a file in Word format, open the file in a browser and edit it.
Rel: Indicates the relationship of the set link: Rel=same indicates that the file to be linked is the same as this file, Rel=next indicates that the file to be linked is the next page, rel=parent that the file is the parent of the file to be linked, and rel=previous that the file to be linked to is the previous page.
Rev: is used to set the reverse link.
Target: Setting a link to which window in the frame window, and target= "_bank" means opening a new window to open the page.
Title: Used to set the caption to be displayed when the link point is selected.
OnClick: Corresponds to an event, which triggers the event when the link is clicked, and executes the corresponding subroutine.
onMouseOver: Similar to onclick, the corresponding event is triggered when the mouse moves over the chain contact.
onmouseout: The corresponding event is triggered after the mouse is moved out of the town contact.
Give a few examples: <a href= "index.htm" > Back to homepage </a>
<a href= "Sound.wav" > Playback voice files </a>
<a href= "Javascipt.open ()" > execute the corresponding program </a>
<a herf= "Document.doc" > Open the corresponding document for processing </a>

Application Skills
1, provide download files
A lot of netizens write to ask, provide download effect how to do. It's actually still a hyperlink, but the downloaded file must be uploaded to the Web site. Example: There is a "web skills" of the file package for download, the filename is "Homepagejq.zip" and has been uploaded to the site, then this link code can write: <a href= "Homepagejq.zip" > click here to download "Web Tips" file package </a>.
2. Open a linked page in a new window
Set the value of "target" to "_blank". For example: Open a new window opens the page "Aboutme.htm". The code that produces this effect is: <a href= "aboutme.htm" target= "_blank" > About me ......</a>.
3, the mouse moves to the link, displays one line to explain the text
You can get this effect by setting the "title" parameter value. Example: When the mouse moved to the "Huangshan Village husband" This link, show the description of "This is a Web page production skills of a professional website." The link code is this: <a href= "hscf.htm" title= "This is a professional website that introduces Web making tips >" Huangshan Village husband </a>.
4, the mouse moved to a link on a pop-up window
This is the result of setting the onmouseover parameter. Example: When you move the mouse over a link, a window pops up and the mouse hover effect demo is displayed in the window. ”。 The link code is this: <a href= "other pages. htm" > Links </a>. A similar method can be used to produce a pop-up window when the mouse is pressed and a pop-up prompt when the mouse leaves.
5, link to the content specified on this page
To implement a link to a portion of this page (that is, "file Jump"), you must specify the name of the chain contact with the parameter name. Select a piece of text that you can name with the name parameter for the link to use. The so-called jump in the same file refers to when the reader is reading a long file, if only a part of the content of interest, you can use the jump-style reading style. The basic format is:
<a href= "# Chain Contact Name" > Part II </a> first section content ...
...........................................
<a name= "Chain Contact name" ></a> Part II actual content ...
...........................................
So when you click on the "second part" of the hyperlink, it will automatically transfer to the "second part of the actual content" this place. The chain contact name defined by the "name" parameter can be arbitrarily taken, but the chain contact name in the linked "href" argument must be consistent, and don't forget to add "#" to the front.
6, linked to other pages of the specified content location
method is similar to the previous example, but add the file name of the Web page before the chain contact name in the "href" argument. Example: There are two pages page1.htm and page2.htm, each page has two parts, now want to make a hyperlink in page1.htm, press the link will go to the second part of the page2.htm content. So we can do this, first of all, in the beginning of the second part of the page2.htm to write the code: <a name= "chain Contact name" ></a>; in page1.htm write such a link code: <a href= " pagw2.htm# Chain Contact Name ">page2 The second part of the content </a>.
7, linked to E_Mail
Clicking on a hyperlink will start the email management software on the client to write to you. Example of this line of code: <a href= "mailto:fyy0528@sina.com" > Please write to me </a>. Once you click on the "please write to me" link, you will automatically start the email management software (such as OE) writing function, and has put the e-mail address in the recipient's address bar.
Links not only can be text as a carrier, but also to image as a carrier, and can be a part of the picture as a carrier, and can achieve these effects, methods are the same, the difference is only the carrier, that is, the link between the two opposite brackets, so no longer another example.

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.