同一个标签, 根据其不同的种状态, 有不同的样式. 这就叫做 "伪类". 伪类用冒号来表示. CSS 伪类用于向某些选择器添加特殊的效果.
CSS 伪类:
:active,:any-link,:blank,:checked,:current,:default,:defined,:dir(),:disabled,:drop,:empty,:enabled,:first,:first-child,:first-of-type,:fullscreen,:future,:focus,:focus-visible,:focus-within,:has(),:host,:host(),:host-context(),:hover,:indeterminate,:in-range:invalid,:is(),:lang(),:last-child,:last-of-type,:left,:link,:local-link,:not(),:nth-child(),:nth-col(),:nth-last-child(),:nth-last-col(),:nth-last-of-type(),:nth-of-type(),:only-child,:only-of-type,:optional,:out-of-range,:past,:placeholder-shown,:read-only,:read-write,:required,:right,:root,:scope,:target,:target-within,:user-invalid,:valid,:visited,:where()
伪类连同伪元素一起, 他们允许你不仅仅是根据文档 DOM 树中的内容对元素应用样式, 而且还允许你根据诸如像导航历史这样的外部因素来应用样式(例如 :visited).
同样的, 可以根据内容的状态 (例如在一些表单元素上的 :checked), 或者鼠标的位置(例如 :hover 让你知道是否鼠标在一个元素上悬浮) 来应用样式.
来源: http://www.css88.com/qa/css3/12421.html