自定义样式的checkbox, radio

<div class="checkbox">

  <label>

    <input type="checkbox"/>

    选择框

  </label>

</div>

 

.checkbox {

  position: relative;

  cursor: pointer;

}

.checkbox input {

  opacity: 0;

}

.checkbox:before {

  content: "";

  display: block;

  position: absolute;

  width: 20px;

  height: 100%;

  background: url(xxx);

}

posted @ 2016-06-19 10:33  清风叶  阅读(130)  评论(0编辑  收藏  举报