css
  • twitter-bootstrap-3
  • internet-explorer-8
  • 2015-11-25 17 views 1 likes 
    1

    我已经制作了像点击复选框的图标,点击更改图标的颜色。它似乎适用于Chrome,IE9 +。但我需要让他们在IE8上工作(点击图标没有被改变)。IE8图标喜欢复选框

    HTML

    <input id="checkbox1" class="icon-checkbox" type="checkbox" /> 
    <label for="checkbox1"> 
    <span class='glyphicon glyphicon-trash unchecked'></span> 
    <span style='color:red;' class='glyphicon glyphicon-trash checked'></span> 
    </label> 
    

    CSS

    input[type='checkbox'].icon-checkbox{display:none} 
    input[type='checkbox'].icon-checkbox+label .unchecked{display:inline} 
    input[type='checkbox'].icon-checkbox+label .checked{display:none} 
    input[type='checkbox']:checked.icon-checkbox{display:none} 
    input[type='checkbox']:checked.icon-checkbox+label .unchecked{display:none} 
    input[type='checkbox']:checked.icon-checkbox+label .checked{display:inline} 
    

    https://jsfiddle.net/tadasvu/DTcHh/14579/

    P.S我有:html5shiv.min.js,respond.min.js包括在内。

    回答

    0

    如果您希望传统IE兼容性,请不要使用兄弟选择器,直接调用类。这应该解决它。

    相关问题