有點糟喔,以後得更常去jQuery和W3Schools挖寶才行
不囉唆,以下簡介常用的CSS Selector技巧(轉錄自W3Schools)
Grouping
h1,h2,h3,h4,h5,h6
{
color: green
}
{
color: green
}
The class Selector(限定Tag)
p.right {text-align: right}
p.center {text-align: center}
或(不限定Tag)p.center {text-align: center}
.center {text-align: center}
Add Styles to Elements with Particular Attributes
input[type="text"] {background-color: blue}
The id Selector(限定Tag)
p#para1
{
text-align: center;
color: red
}
或(不限定Tag){
text-align: center;
color: red
}
#green {color: green}
沒有留言:
張貼留言