jQuery / CSS高级单选按钮插件

时间:2017-08-23 08:28:15

标签: jquery css plugins

我想知道是否有任何插件或任何简单的方法来实现类似的东西(它是某种将选择器移动到所选选项的单选按钮) - 提前致谢: enter image description here

2 个答案:

答案 0 :(得分:1)

border-radius: Xpx;

并设定 Hover按钮

答案 1 :(得分:0)



.container{
  display: inline-block;
  border:1px solid lightgray;
  border-radius:40px;
}

input[name=radio]{
  display: none;
}

label{
  display: inline-block;
  width: 100px;
  height: 40px;
  text-align: center;
  line-height: 40px;
  border-radius: 40px;
  cursor: pointer;
}
input:checked + label{
  background-color: skyblue;
  color: white;
}

<div class="container">
  <input type="radio" name="radio" id="radio-1" checked/>
  <label for="radio-1">Round</label>
  <input type="radio" name="radio" id="radio-2" />
  <label for="radio-2">One Way</label>
  <input type="radio" name="radio" id="radio-3" />
  <label for="radio-3">Multi</label>
</div>
&#13;
&#13;
&#13;