亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

4個都沒變化,且opacity=0屬性沒用

4個都沒變化,且opacity=0屬性沒用

liangandi 2016-10-29 10:41:46
只是第一個出現了變化,有顏色有三角形,但是后面4個無論怎么點都沒變化即使是移到上面也毫無變化,怎么回事?.st-container input:checked + a,.st-container input:checked:hover + a{ background-color: #821134; /*設置被選中了顏色恒定不變*/}.st-container input:checked + a:after{ content:""; width:0; height:0; overflow: hidden; border: 20px solid transparent; border-bottom-color: #821134; position:absolute; bottom: 100%; left:50%; margin-left: -20px; /*使三角形居中的方法*/ /*溫習下:after的用法*/}.st-container input:hover + a{ background: #AD244F; /*鼠標滑過的背景顏色發生變化*/}
查看完整描述

3 回答

?
liangandi

TA貢獻1條經驗 獲得超0個贊

謝謝,經過一天的努力已經把她完完全全做出來了...

查看完整回答
反對 回復 2016-10-29
?
stone310

TA貢獻361條經驗 獲得超191個贊

試了下代碼能出

<!DOCTYPE?html>
<html>
<head>
????<title></title>
????<meta?charset="UTF-8">
????<style>
????????.st-container?{
????????????height:?100px;
????????????width:?200px;
????????????position:?relative;
????????}
????????.st-container?input:checked?+?a,
????????.st-container?input:checked:hover?+?a?{
????????????background-color:?#821134;
????????????/*設置被選中了顏色恒定不變*/
????????}
????????.st-container?input:checked?+?a:after?{
????????????content:?"";
????????????width:?0;
????????????height:?0;
????????????overflow:?hidden;
????????????border:?20px?solid?transparent;
????????????border-bottom-color:?#821134;
????????????position:?absolute;
????????????bottom:?100%;
????????????left:?50%;
????????????margin-left:?-20px;
????????????/*使三角形居中的方法*/
????????????/*溫習下:after的用法*/
????????}
????????.st-container?input:hover?+?a?{
????????????background:?#AD244F;
????????????/*鼠標滑過的背景顏色發生變化*/
????????}
????</style>
</head>
<body>
<div?class="st-container">
????<input?type="checkbox"/>
????<a>sdfasdfsdf</a>
</div>
<div?class="st-container">
????<input?type="checkbox"/>
????<a>sdfasdfsdf</a>
</div>
<div?class="st-container">
????<input?type="checkbox"/>
????<a>sdfasdfsdf</a>
</div>
<div?class="st-container">
????<input?type="checkbox"/>
????<a>sdfasdfsdf</a>
</div>
</body>
</html>


查看完整回答
反對 回復 2016-10-29
?
李曉健

TA貢獻1036條經驗 獲得超461個贊

你可以給一下完整的代碼看下,包括html代碼

查看完整回答
反對 回復 2016-10-29
  • 3 回答
  • 0 關注
  • 2162 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號