?? ?? ??? ???
?? ?? ??? ???? ?? ??? ???? ?????. ??? ??? ????.
E: pseudo-class {property:value}
??? E? HTML? ????, ?? ???? CSS? ?? ??? ??? ????, ??? ?????. CSS? ??? value? CSS ?? ????.
?? ?? ???? HTML? ???? ??? ???? ? ???? ?? ??? ?? ??? ? ????. ?? ?? ????? ? ?? ??? ????. ? ??? ???? ?? ? ? ?? ?? ?? ?????, ?? ??? ??? ?? ?? ??????.
???? ?? ??? ??? ????.
IE8 ??? ??? E:active ? E:focus? ???? ?? ?? ?? ??? ???? ?? ?????? ?????.
?? ??? ???? ??? ???? ??? ? ??? ??? ?? ?? ?? ?? ??? ???? ??????.
<!DOCTYPE HTML> <HTML lang="en-US"> <HEAD> <META charset="UTF-8"> <TITLE>使用動態(tài)偽類選擇器美化按鈕</TITLE> <STYLE type="text/css"> .download-info { text-align: center; } /*默認(rèn)狀態(tài)下的按鈕效果*/ .btn { background-color: #0074cc; *background-color: #0055cc; /*CSS漸變制作背景圖片*/ background-image: -ms-linear-gradient(top, #0088cc, #0055cc); background-image: -webkit-gradient(linear, 0, 0, 0 100%, from(#0088cc), to(#0055cc)); background-image: -webkit-linear-gradient(top, #0088cc, #0055cc); background-image: -o-linear-gradient(top, #0088cc, #0055cc); background-image: -moz-linear-gradient(top, #0088cc, #0055cc); background-image: linear-gradient(top, #0088cc, #0055cc); background-repeat: repeat-x; display: inline-block; *display: inline; border: 1px solid #cccccc; *border: 0; border-color: #ccc; /*CSS3的色彩模塊*/ border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); border-radius: 6px; color: #ffffff; cursor: pointer; font-size: 20px; font-weight: normal; filter: progid:dximagetransform.microsoft.gradient(startColorstr='#0088cc', endColorstr='#0055cc', GradientType=0); filter: progid:dximagetransform.microsoft.gradient(enabled=false); line-height: normal; padding: 14px, 24px; /*CSS3文字陰影特性*/ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); text-decoration: none; vertical-align: middle; *zoom: 1; } /*懸浮狀態(tài)下按鈕效果*/ .btn:hover { background-position: 0 -15px; background-color: #0055cc; *background-color: #004ab3; color: #ffffff; text-shadow: 0, -1px 0 rgba(0, 0, 0, 0.25); /*CSS3動畫效果*/ -webkit-transition: background-position 0.1s linear; -moz-transition: background-position 0.1s lineaar; -ms-transition: background-position 0.1s linear; -0-transition: background-position 0.1s linear; transition: background-position 0.1s linear; } /*點(diǎn)擊時(shí)按鈕效果*/ .btn:active { background-color: #0055cc; *background-color: #004ab3; background-color: #004099 ; background-image: none; outline: 0; /*CSS3盒子陰影特性*/ box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.15); color: rgba(255, 255, 255, 0.75); } /*獲得焦點(diǎn)按鈕效果*/ .btn: focus { outline: thin dotted #333; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } </STYLE> </HEAD> <BODY> <div class="download-info"> <a hred="#" class="btn">View project on GitHub</a> </div> </BODY> </HTML>
?? ??? ??? ????(.btn ?? ??? ??):
??? ?? ?? ?? ? ??(.btn:hover? ??? ?? ???):
??? ???? ?? ??(.btn:active? ???? ???) ???):
Love-Hate ??(LoVe/HAte):
?? ?? ???? ??? "Love-Hate ??" LoVe/HAte, ? link-visited-? ???? ???. hover-active.(L-V-H-A) ?? IE6, IE7, IE8??? a:hover, a:active, a:visited? ??? ??? ????? ?? ???? ???? ????. ??? ?? ??? ???? ??? ?? ??? ??????.
IE6 IE7(Q) IE8(Q)? ?? A ??? :visited :hover :active ?? ???? ???? ???? ????? ?? ???? ???? ????