2008年8月13日 星期三

CSS Selectors

今天才發現的技巧 :-p

有點糟喔,以後得更常去jQuery和W3Schools挖寶才行

不囉唆,以下簡介常用的CSS Selector技巧(轉錄自W3Schools)

Grouping
h1,h2,h3,h4,h5,h6
{
color: green
}

The class Selector(限定Tag)
p.right {text-align: right}
p.center {text-align: center}
或(不限定Tag)
.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)
#green {color: green}

沒有留言:

張貼留言