HTML Learning note 13--html with semantic tags 2_a tags

Source: Internet
Author: User

5. About hyperlinks

denoted by a tag.

Basic usage: <a href= URL > page link text hint </a> where the URL can be either a local HTML file or a Web page.

Advanced usage: <a href= "url" target= "_blank" title= "xxx" > Link text tips on the page </a>

Target that part means to open the link in a new window, the title part is, put the mouse on the link hint text, will appear "xxx" prompt text, as shown in Example 2.

As shown in Example 1, "http" must not be omitted.

Example 1

The effect is as follows, where Link5 is no way to connect to Baidu, an error occurred (because in the current directory, Baidu is not found).

1 <!DOCTYPE HTML>2 <HTMLLang= "en">3 <Head>4     <MetaCharSet= "UTF-8">5     <title>Link Exercises</title>6 </Head>7 <Body>8     <ahref= "http://wwww.baidu.com/"Target= "_blank"title= "Baidu Home">Baidu 1ink 1</a>   <!a complete representation->9     <ahref= "http:www.baidu.com/">Baidu Link 2</a>      <!Remove the "//"->Ten </Body> One </HTML>
Example 2

Title of the hint text "Baidu home", note: In the mouse on the "Baidu Link1" text will be displayed.

New window open effect:

6. Anchor Point

Syntax: <a name= "XX" ></a>

Through the content behind name, Mark somewhere on the page, use the anchor point to make a link to the mark, as shown in the following example, if the page is too long and inconvenient to browse, you can create a link through the anchor point.

1 <!DOCTYPE HTML>2 <HTMLLang= "en">3 <Head>4     <MetaCharSet= "UTF-8">5     <title>Link Exercises</title>6 </Head>7 <Body>8     <ahref= "link.html# Anchor point 1">Anchor Point 1 links</a>  9     <ahref= "link.html# Anchor point 2">Anchor Point 2 links</a>  Ten     <ahref= "link.html# Anchor point 3">Anchor Point 3 Links</a>   One  A     <aname= "Anchor point 1"></a> -     <P>Anchor Point 1</P> -     </BR> the     </BR> -     </BR> -     </BR> -     </BR> +     </BR> -     </BR> +     </BR> A     </BR> at     <aname= "Anchor point 2"></a> -     <P>Anchor Point 2</P> -     </BR> -     </BR> -     </BR> -     </BR> in     </BR> -     </BR> to     </BR> +     </BR> -     <aname= "Anchor point 3"></a> the     <P>Anchor Point 3</P> *     </BR> $     </BR>Panax Notoginseng     </BR> -     </BR> the     </BR> +     </BR> A     </BR> the     </BR> +     </BR> -     </BR> $     </BR> $     </BR> -     </BR> -     </BR> the     </BR> -     </BR>Wuyi     </BR> the </Body> - </HTML>
Example 3

When you click on the link text, the page automatically jumps to the appropriate anchor point

7. Pseudo-Class

CSS allows the 4 states of a tag to set their own CSS features, called CSS Pseudo-class;

Four states ( must be written in order Lvha): The general link (link, this link can be omitted do not write), click on the link (visited), the mouse on the point (hover), the mouse point down has not been released (active, generally not used)

Examples will be reflected in the actual production of the following pages ~

HTML Learning note 13--html with semantic tags 2_a tags

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.