伪类选择器

超链接

a:link
  {color: #FF0000}  
a:visited
  {color: #00FF00}  
a:hover
  {color: #FF00FF}  
a:active
  {color: #0000FF} 

a:hover 必须被置于 a:link 和 a:visited 之后
a:active 必须被置于 a:hover 之后

:focus

input:focus
{
background-color:yellow;
}

:first-child

These are the necessary steps:

  • Intert Key
  • Turn key clockwise
  • Push accelerator

Do not push the brake at the same time as the accelerator.

p:first-child {font-weight: bold;}

作为某元素第一个子元素的所有 p 元素设置为粗体

li:first-child {text-transform:uppercase;}

作为某个元素(在 HTML 中,这肯定是 ol 或 ul 元素)第一个子元素的所有 li 元素变成大写

:lang

引号
http://baike.baidu.com/link?url=m0BjQq_9meaWqCCpajQxkPST-DHbtas6YZF6OU4aS7oCF83CjCeG4dFLQj2i3ck6sNhj6oUX6A9OWZjo0g6J7q

:lang(en) > Q { quotes: '\201C' '\201D' '\2018' '\2019'; }
:lang(fr) > Q { quotes: '« ' ' »'; }
:lang(de) > Q { quotes: '»' '«' '\2039' '\203A'; }
This French quote has a nested quote.
This German quote has a nested quote.
This English quote has a nested quote.
looks like.png

你可能感兴趣的:(伪类选择器)