CSS changes hyperlink style using CSS

Source: Internet
Author: User

    • Hyperlink code
1 <ahrefahref= "http://www.divCSS5.com/" target= "_blank"  2
    • The parsing is as follows:

HREF followed by linked address destination website address this is http://www.divCSS5.com/.
Target
_blank--open a link in a new window
_parent--open a link in the parent form
_self--Open link in current form, this is the default value
_top--opens the link in the current form and replaces the current entire form (frames page)

The title is followed by a link target description, which is a brief description of the hyperlink being linked URL, or the title

    • CSS controls hyperlink style-CSS link style is as follows

A:active is the initial state of the hyperlink
A:hover is the situation when you put the mouse on it.
A:link is when the mouse clicks
A:visited is the situation after the visit

    • Hyperlink style case

1, usually the whole station hyperlink style method

1 a{color: #333; text-decoration:none;}   2 // The text color style that has links to the whole site is a colour  : #333; 3 and immediately without underline text-Decoration:none;   4 a:hover{color: #CC3300; text-decoration:underline;} // the text color style changes  to a hyperlink on the mouse 5 color: #CC3300;   6 and text links underlined Text-decoration:underline;  

2. Control hyperlink style CSS method by setting class in link

Case Hyperlink Code

1 2 CSS   3 </a>

Corresponding CSS code

1 a.yangshi{color: #333; text-decoration:none;}   2 a.yangshi:hover{color: #CC3300; text-decoration:underline;}  

This allows you to control the style of the CSS class name "Yangshi" hyperlink within the link

3. Control the style of hyperlinks by CSS styles that correspond to the parent CSS class outside the hyperlink

Case Hyperlink Code

1 2 3 4

Corresponding CSS code

1 . Yangshia{color: #333; text-decoration:none;}   2 . Yangshia:hover{color: #CC3300; text-decoration:underline;}  

It is noteworthy that A.yangshi and. Yangshia Style CSS Code differences, here is common through the divcss to the hyperlink style set case and analysis.

CSS changes hyperlink style using CSS

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.