fc2ブログ
WEBマスター目指して日々勉強!!
page top
[css2] first-childを使う
CATEGORY/css2
first-child:ある親要素の最初の子供要素だけマッチします。

具体例)

p:first-child { font-weight:bold; }

<p>1</p>
<p>2</p>
<p>3</p>


ただ、IE 5.5 と 6 は機能しません。
そこで「expression(IE 独自拡張)」を使い使用できるようにします。
※JavaScriptが無効だと機能しません。。。

使用例)

p:first-child{ font-weight:bold; }
p.first-child{ /*IE-expression (first-child) */
 font-weight:bold;
}
p{ /* IE-expression (first-child) */
behavior: expression(
this.className += (this.previousSibling == null) ? " first-child" : "",
this.style.behavior = "none"
);
}


スポンサーサイト



page top
[css 2] フォントサイズ
CATEGORY/css2
CSSのフォントサイズの%が何pxかいつも忘れます。。。
検索したら参考になるサイト発見!

とてもしんせつですねー

http://colo-ri.jp/develop/2008/03/css.html
page top
[css 2] ハック
CATEGORY/css2
「CSS」「ハック」で検索したら、
こんな親切なサイトが、、

わかりやすく重宝します。

http://d-lover.com/css/hack.shtml

clearfix」は便利ですね。
© WEB-WORKMAN. all rights reserved.
Page top
FC2 BLOG