The a tag in HTML

Source: Internet
Author: User

<a> tag defines a hyperlink that is used to link from one page to another. The most important attribute is the href attribute, which indicates the target of the link,

1. Click the hyperlink to display the window:

Target property: Used to specify where to open the link:

(1) target= "_blank": the browser always loads the target document in a newly opened, unnamed window. (2) target= "_self": Open on Current page (3) target= "_parent": Open in Parent space (4) target= "_top": Open in Top page (3) (4) Yes <  iframe> mate <a> Use effect of tags

2. Display the following lines:

Text-decoration is a CSS property, but it is often used in <a> tags to display or remove the underline of hyperlinks. The property values are as follows:
None: Default. Defines the standard text. The parameter indicates that the hyperlink text does not appear underlined;
Underline: Defines a line below the text. The argument indicates that the text of the hyperlink is underlined;

Overline: Defines a line on the text.

Line-through: Defines a line that passes through the text.

Blink: Defines the blinking text.

Inherit: Specifies that the value of the Text-decoration property should be inherited from the parent element.

<style= "Text-decoration:none;" >

3. As a hyperlink four states:

First state: Link (default) normal state (the initial state, without the mouse to touch) The second state: hover Mouse on the time (but do not click) The third State: when the active click (the mouse has not released) the fourth state: visited click After ()
<!DOCTYPE HTML Public "-//W3C//DTD XHTML 1.0 strict//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd ">  <HTMLxmlns= "http://www.w3.org/1999/xhtml"Lang= "ZH-CN">  <Head>  <title>CSS pseudo-Class</title>  <Metahttp-equiv= "Content-type"content= "text/html; charset= UTF8" />  <style>A:link{Color:Black;  }a:visited{Color:Blue;  }a:hover{Color:Orange;  }a:active{Color:Pink;  }  </style>  </Head>      <Body>      <ahref= "Http://www.baidu.com">Jason</a>      </Body>  </HTML>  
Note When using:
    1. Active generally does not have to write
    2. Four state controls must be written in LVHA order.
    3. Link can omit

4, sometimes we will encounter this form:

a:focus{    color:lime;    background:red;}

Where : Focus is a CSS pseudo-class selector for selecting the element that gets focus. Common forms are as follows:

a:focus{    color:lime;    background:red;} input:focus{    Color:yellow;    Background:blue;}

The a tag in HTML

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.