Pseudo-class selectors in CSS3

Source: Internet
Author: User

class selector differs from pseudo class selector  

class Selector We can name it arbitrarily, and pseudo-class selectors are A selector that is already defined in CSS is not allowed to be named at will.

  

Pseudo-class selectors and pseudo-elements

We'll put it in here.

  p.aaas{

  Text-align:left;

  color:red;

  }

it will be chosen in the same way.

  The most common pseudo-class selectors

  Links that have not been visited

  a:link{color: #ff6600}/* link not visited * /

Let's test it and we'll add a hyperlink to it.

  Pseudo class Selector

We give this pseudo-class selector, select the style, the first type

  a:link{

  Color: #000;

  }

  Link It is the non-visited links represented

  Links that have been visited

  a:visited{

  Color:fuchsia;

  }

Then we put the mouse on the, a color.

  a:hover{

  Color:green;

  }

It turns green when we put the mouse on it. There is also a time when our mouse is being clicked.

  a:active{

  Color: #ff6600;

  }

will show the orange, so that defines a pseudo-class, when we do not have access to the link is black, when we have access to this link, when we return to this page, the color of the link will become purple, when we mouse over it, it will become green, when we click on the time, it would be the same, Is that we left the mouse button down, but did not bounce back when it will become orange. OK then let's look at the effect.

now is such a color, is purple. Purple means that we have already visited. Since we are now returning to this page, we can change it here, to Index1.

  Pseudo class Selector

because index1 does not exist, it does not exist to be visited.

so before the visit is black link, when we move this mouse up

will turn green, when we click on the mouse but not released, it will become

Orange. When we release it, it will be accessed and it will become purple after the visit. We create a new page index1, so it turns purple when you click and then return. This is the pseudo class.

original link:http://www.maiziedu.com/wiki/css3/selector/

Pseudo-class selectors in CSS3

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.