- グロウ: 使用
box-shadow
- より暗く表示されます : ビットを変更する
background
か、マスクを適用します (マスクは疑似要素である可能性があります)。
- わずかに移動します: a を変更
margin
または使用しtranslate
transform
ます。
- わずかに大きく
width
なります : を変更height
または使用しscale
transform
ます。
次の 2 つについては、transform
s をお勧めします。これらはAndroid でサポートされており、リンクを移動またはスケーリングしても、その周りの要素が邪魔されない (= 移動しない) という利点があります。
デモ(マウス ボタンを押し続けると効果が表示されます)
関連する CSS:
.glow:active { box-shadow: 0 0 15px #fe0; }
.darker:active { background: goldenrod; }
.move:active { margin-left: 50px; } /* moves elements at its right */
.move2:active { transform: translateX(15px); }
.bigger:active { width: 120px; height: 66px; } /* moves alements after it */
.bigger2:active { transform: scale(1.1); }
注: transform
s の場合、接頭辞なしのバージョンをサポートする現在のバージョンのブラウザーがないため、接頭辞なしのバージョンの前に接頭辞付きのバージョンを追加する必要があります (IE 10 と Firefox 16 は、接頭辞なしの変換をサポートすることが発表されています)。
.move:active {
-webkit-transform: translateX(15px); /* the one you need for Android */
/* if your app is ONLY for Android, you can leave the next three out */
-moz-transform: translateX(15px);
-ms-transform: translateX(15px);
-o-transform: translateX(15px);
transform: translateX(15px); /* always write it last */
}
.bigger:active {
-webkit-transform: scale(1.1); /* the one you need for Android */
/* if your app is ONLY for Android, you can leave the next three out */
-moz-transform: scale(1.1);
-ms-transform: scale(1.1);
-o-transform: scale(1.1);
transform: scale(1.1); /* always write it last */
}
transition
スムーズなsが必要な場合は、同じことが有効です。
a.ui-link-test {
-webkit-transition: .5s; /* the one you need for Android */
/* if your app is ONLY for Android, you can leave the next three out */
-moz-transition: .5s;
-ms-transition: .5s;
-o-transition: .5s;
transition: .5s; /* always write it last */
}