作者chrisQQ (ChrisLiu)
看板Web_Design
標題Re: [CSS]a:style1{} #style2{} .style3{} style4{ …
時間Sat Jul 4 00:33:27 2009
※ 引述《ieping (maggie)》之銘言:
: 以下CSS分別代表的意思 style 前加# . a:
: #style{
: }
: .style{
: }
: a:style{
: }
: style{
: }
: thanks
<div id="top" class="width200"><a href="localhost">點我點我</a></div>
#top {
background: #000;
}
/* #top 影響的是 id="top" 的 tag */
.width200 {
width:200px;
}
/* .width200 是影響 class="width200" 的 tag */
div {
border: 1px;
}
/* div 是影響所有 div 的 tag */
另外 : 應該算特例… 沒有 a:style 這種吧
有的大概是這些
a:link { color: red } /* unvisited links */
a:visited { color: blue } /* visited links */
a:hover { color: yellow } /* user hovers */
a:active { color: lime } /* active links */
a:focus { background: yellow }
a:focus:hover { background: white }
btw 這篇有詳細的解說…
我應該先 google 再打的…
http://www.w3.org/TR/CSS2/selector.html
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 203.145.202.66
推 kyork:推你有心,這種隨便問的我根本不想認真回答XD 07/04 00:35
推 ieping:謝謝~ Sorry 發文前忘記加請 07/04 03:57