This question already has answers here:
Is it posible to make an input checkbox a Bootstrap glyphicon?
                                
                                    (3个答案)
                                
                        
                                2年前关闭。
            
                    
我需要做引导glyphicon复选框

 <label class="checkbox-inline"><input type="checkbox" value=""/>
    To Download<div class="glyphicon glyphicon-download"></div>
</label>


但是我想把glyphicon放到复选框的位置。预先感谢您的回答

最佳答案

试试这个,它将起作用..

工作代码段



.glyphicon:before {
 visibility: visible;
}
.glyphicon.glyphicon-download:checked:before {
   content: "\e013";
}
input[type=checkbox].glyphicon{
    visibility: hidden;

}

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
          <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
          <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>



</head>
<body>
<label class="checkbox-inline"><input type="checkbox" class="glyphicon glyphicon-download" value=""/>
    To Download
</label>
</body>
</html>

关于css - Bootstrap glyphicon复选框CSS ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/41868692/

10-13 01:42