2010年3月3日水曜日

backgroundの一括指定メモ。

background指定の際、

background-image:url(example.jpg) no-repeat;
ではエラーで、
background:url(example.jpg) no-repeat;
はOK。

なぜなら、background:という指定方法は、「ショートハンド」として複数の属性値を指定可能。

background:url(example.jpg) no-repeat 5px 0;
などとしたら、leftから5px,topは変わらず、となる。
数値指定は、left topの順番。

background,短くて便利。

0 件のコメント:

コメントを投稿