码迷,mamicode.com
首页 > 其他好文 > 详细

改写radio样式

时间:2018-10-30 13:09:43      阅读:203      评论:0      收藏:0      [点我收藏+]

标签:splay   box   put   osi   text   ddl   abs   标签   div   

<div class="test">
  <input type="radio" name="radioHouse" class="radio" id="big">
  <label for="big">大床房</label>
</div>
<div class="test">
  <input type="radio" name="radioHouse" class="radio" id="small">
  <label for="small">小床房</label>
</div>
 
.radio{
  position: absolute;  //隐藏label标签原本的样式
  clip: rect(0, 0, 0, 0);
}
.radio:checked + label::before{
  content: "\a0";
  display: inline-block;
  width:0.25rem;
  height:0.25rem;
  border-radius: 50%;
  opacity:0.9;
  border:0.05rem solid #55D8C2;
  background-clip: content-box;
  background-color: #01cd78;
  padding: .2em;
}
.radio + label::before{
  content: "\a0";
  display: inline-block;
  width:0.55rem;
  height:0.55rem;
  border-radius: 50%;
  opacity:0.9;
  border:0.05rem solid #999;
  text-indent: .15em;
  line-height: 0.5rem;
  margin-right: .4em;
  vertical-align: middle;
}

改写radio样式

标签:splay   box   put   osi   text   ddl   abs   标签   div   

原文地址:https://www.cnblogs.com/wangpeiyuan/p/9876002.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!