css pseudo class selector
Function: select an element with a special state
Like a class but not a class, it is a special state of the element.
/* 选中的是没有访问过的a元素 */
a:link{
color:orange;
}
/* 选中的是访问过的a元素 */
a:visited{
color:gray;
}
/* 选中的是鼠标悬浮状态的a元素 */
a:hover{
color:blue;
}
/* 选中的是激活状态的a元素 */
a:active{
color:red;
}
input:focus{
color:green;
}
What is activation? Just press the mouse and don’t release it
Note: In order, namely: link, visited, hover, active
:focus
Only form elements that get focus
can use the :focus pseudo-class