アクセスカウンタ
読者登録
メールアドレスを入力して登録する事で、このブログの新着エントリーをメールでお届けいたします。解除は→こちら
現在の読者数 1人
プロフィール
スポンジボブ

2011年05月13日

CSS3で背景とグラデーションを同時に設定する

CSS3で背景とグラデーションを同時に設定するときは、

background:背景,グラデーション

のように指定する。
以下の指定で、Firefox,Chrome,IE6-8確認。

.radiusBtn a{
background: url(../images/common/whitearrow.gif) no-repeat 7px 0,linear-gradient(#80C4AA, #008955); /* CSS3 */
background: url(../images/common/whitearrow.gif) no-repeat 7px 0,-moz-linear-gradient(top, #80C4AA, #008955); /* Firefox */
background: url(../images/common/whitearrow.gif) no-repeat 7px 0,-webkit-gradient(linear, left top, left bottom, from(#80C4AA), to(#008955)); /* Safari,Chrome */
-pie-background: url("../images/common/whitearrow.gif") no-repeat 7px 0,linear-gradient(#80C4AA, #008955); /* IE678 */
behavior: url("/PIE.htc"); /* CSS3 PIE */
}

リンク要素でhoverのときに動きをつけたい場合
(グラデーションをベタに):


.radiusBtn a:active, .radiusBtn a:hover {
background: #008955 url(../images/common/whitearrow.gif) no-repeat 7px 0;
-pie-background: #008955 url("../images/common/whitearrow.gif") no-repeat 7px 0;
}

IE6では別途リンク時の設定が必要。

* html .radiusBtn a:link, .radiusBtn a:visited {
color: #FFF;
text-decoration: none;
}

* html .radiusBtn a:active, .radiusBtn a:hover {
color: #FFF;
text-decoration: none;
}

同じカテゴリー(html)の記事画像
背景画像が途中できれる
同じカテゴリー(html)の記事
 角丸のボーダーをCSSで表示 (2011-03-09 10:46)
 背景画像が途中できれる (2011-01-13 00:40)
 IE6の動作について (2010-12-15 13:32)
 imodeでアンカーが効かない (2010-11-26 23:25)
Posted by スポンジボブ at 13:08│Comments(0)html
※このブログではブログの持ち主が承認した後、コメントが反映される設定です。
コメントフォーム
上の画像に書かれている文字を入力して下さい
<ご注意>
書き込まれた内容は公開され、ブログの持ち主だけが削除できます。