###前提・実現したいこと
CSSで書いたボタンにカーソルが重なるとシェードが出るようなコードを書いています。
押した時のアクションは書いているのですが、カーソルがボタン部分に重なった時になにか変化があるというのをどう書けばいいか困っています。
###該当のソースコード
HTML/CSS
1<!doctype html> 2<html> 3<style> 4 5.btn{ 6 display: inline-block; 7 position: relative; 8 text-decoration: none; 9 color: #727B69; 10 width: 150px; 11 height: 50px; 12 line-height: 50px; 13 border-radius: 5px; 14 text-align: center; 15 vertical-align: middle; 16 overflow: hidden; 17 font-weight: bold; 18 background-image: -webkit-linear-gradient(#c7e6e2 0%, #c7e6e2 50%); 19 background-image: linear-gradient(#c7e6e2 0%, #c7e6e2 50%); 20 filter:alpha(opacity=70); 21 -moz-opacity: 0.7; 22 opacity: 0.7; 23 24} 25 26.btn:active{/*押したとき*/ 27 -ms-transform: translateY(2px); 28 -webkit-transform: translateY(2px); 29 transform: translateY(2px);/*沈むように*/ 30 box-shadow: 0 0 1px rgba(0, 0, 0, 0.15); 31 background-image: -webkit-linear-gradient(#c7e6e2 0%, #c7e6e2 100%); 32 background-image: linear-gradient(#c7e6e2 0%, #c7e6e2 100%); 33} 34</style> 35<body> 36<center> 37 38<div class="download"> 39 <a class="btn" a href="https://teratail.com/">Download</a> 40 </div> 41</center> 42</body> 43</html>
###補足情報(言語/FW/ツール等のバージョンなど)
より詳細な情報
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2017/08/04 03:02