:link 未訪問html
:visited 已訪問ide
:hover 鼠標懸停post
:active 鼠標按下spa
:not(s) 匹配不含s選擇器的元素code
:frist-child 父元素的第一個元素orm
:last-child 父元素的最後一個元素htm
:only-child 父元素的惟一一個元素blog
:checked 選中 :checked+僞元素utf-8
<!DOCTYPE html> <html lang="zh-cmn-Hans"> <head> <meta charset="utf-8" /> <title>:checked+僞元素</title> <meta name="author" content="Joy Du(飄零霧雨), dooyoe@gmail.com, www.doyoe.com" /> <style> input:checked + span { background: #f00; } input:checked + span:after { content: " 我被選中了"; } </style> </head> <body> <form method="post" action="#"> <fieldset> <legend>選中下面的項試試</legend> <ul> <li><label><input type="radio" name="colour-group" value="0" /><span>藍色</span></label></li> <li><label><input type="radio" name="colour-group" value="1" /><span>紅色</span></label></li> <li><label><input type="radio" name="colour-group" value="2" /><span>黑色</span></label></li> </ul> </fieldset> <fieldset> <legend>選中下面的項試試</legend> <ul> <li><label><input type="checkbox" name="colour-group2" value="0" /><span>藍色</span></label></li> <li><label><input type="checkbox" name="colour-group2" value="1" /><span>紅色</span></label></li> <li><label><input type="checkbox" name="colour-group2" value="2" /><span>黑色</span></label></li> </ul> </fieldset> </form> </body> </html>
::beforeinput
::after