When we browse the site, we will click on some links, these links before the point, there are different effects after the point, these effects are made with the pseudo-element selector
Pseudo element selector:
is to pre-define some selectors in the httml to become pseudo-elements.
Format: Tag name: pseudo-element: class name tag name. Class Name: Pseudo element
Status of the hyperlink:
A:link: Hyperlink not clicked Status
A:visited state after being visited
A:hover the cursor moves to the status on the hyperlink (not clicked), hover
A:active status when clicking a hyperlink
Use order: l-v-h-a, before and after a click is a state
It is best to test with IE browser, some browsers may not see the effect
<style type= "Text/css" > /* not visited * /a:link{background-color: #06F; Color: #FFF; Text-decoration:none; font-size:15px; } /* Mouse Hover * /a:hover{background-color: #FFF; color: #F00; font-size:20px; } /* Click Effect * /a:active{background-color: #000; color: #FFF; font-size:25px; } /* Click after effect * /a:visited{background-color: #FF9; color: #000; Text-decoration:line-through; } </style>
The paragraph label also looks like the effect
P:first-line: The first line of text in a paragraph
P:first-letter: The first letter in a paragraph
: Focus: Has a focused element (Ps:ie6 not supported, Firefox,google can see effects)
<style type= "Text/css" > div:hover{ /* Similar to hover effect can be added to div * /background-color: #F00; Color: #FFF; } input:focus{ background-color: #F0F; } </style>
the combination of CSS style application:CSS can be used in conjunction with numerous tags in html
CSS Learning Note two