如何用CSS3实现单选框的选定取消及切换
<input type="radio" checked="checked">
<a href="#">页面1</a>
<input type="radio">
<a href="#">页面2</a>
选中input实现使input 下的a链接到相应页面
<input type="radio" checked="checked">
<a href="#">页面1</a>
<input type="radio">
<a href="#">页面2</a>
选中input实现使input 下的a链接到相应页面
2016-09-08
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>
举报