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