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

為了賬號安全,請及時綁定郵箱和手機立即綁定

如何用CSS3實現單選框的選定取消及切換

<input ?type="radio" checked="checked">

<a href="#">頁面1</a>

<input ?type="radio">

<a href="#">頁面2</a>

選中input實現使input 下的a鏈接到相應頁面

正在回答

2 回答


input,a{
?? ?position:fixed;
?? ?width:100px;
?? ?height:50px;
?? ?line-height:50px;
}
input{
?? ?opacity:0;
?? ?z-index:100;
}
a{
?? ?background-color:blue;
?? ?font-size:16px;
?? ?color:#fff;
?? ?font-weight:bold;
?? ?text-decoration:none;
?? ?text-align:center;
?? ?z-index:10;
}
.a2,.a2+a{
?? ?left:100px;
}

input:checked+a{
?? ?background-color:red;
}

</style>
</head>
<body>
<input? type="radio" name="radio-set" checked="checked" class="a1">
<a href="#">頁面1</a>
<input? type="radio" name="radio-set" class="a2">
<a href="#">頁面2</a>

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

如何用CSS3實現單選框的選定取消及切換

我要回答 關注問題
微信客服

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

幫助反饋 APP下載

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

公眾號

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