オンマウス時に下線が入るようにしたのですが、横100%で表示されません。
どうすればいいですか?
html
1<li class="item alt1"> 2 <a href="../index.html" target="_top" >ホーム </a> 3</li> 4<li class="item alt1"> 5 <a href="#" target="_top" > ブログ </a> 6</li>
css
1/* オンマウス時下線追加 */ 2/* 通常時(マウスカーソルがのっていない時)のデザイン */ 3.item{ 4 border-bottom: none; /* 装飾なし */ 5} 6 7/* オンマウス(hover)時 */ 8.item:hover{ 9 border-bottom-width:2px; 10 border-bottom-color:#F00; 11 border-bottom-style: solid; 12}
全CSSです。
css
1body{ 2 background: #FFF; 3 margin:0; 4} 5 6.nav{ 7 /* 上部の隙間調節 */ 8 margin-top:23px; 9} 10ol,ul{ 11 /* 文字の前に付く点をなくす */ 12 list-style:none ; 13} 14a{ 15 /* 下線を消す */ 16 text-decoration:none; 17} 18li{ 19 /* 周りの空間を調節 */ 20 margin:5px; 21} 22.item{ 23 24 /* 文字をセンタリングする */ 25 text-align:center 26} 27.wap{ 28 position: relative; 29 overflow: hidden; 30} 31.wap ul { 32 position: relative; 33 left: 50%; 34 float: left; 35} 36.wap ul li { 37 position: relative; 38 left: -50%; 39 float: left; 40} 41 42 43.alt1{ 44 border-right-width:1px; 45 border-right-color:#A49D9D; 46 border-right-style: solid; 47} 48 49 50 51/* オンマウス時下線追加 */ 52/* 通常時(マウスカーソルがのっていない時)のデザイン */ 53.item{ 54 border-bottom: none; /* 装飾なし */ 55} 56 57/* オンマウス(hover)時 */ 58.item:hover{ 59 border-bottom-width:3px; 60 border-bottom-color:#F00; 61 border-bottom-style: solid; 62}
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/10/08 14:43
2016/10/08 14:52
2016/10/08 15:05