我做填充,但他没有出现。如何在select中添加填充?
select.custom{
padding: 30px!important;
-moz-appearance: none;
-webkit-appearance:none;
}
select.custom option{
padding: 30px!important;
-moz-appearance: none;
-webkit-appearance:none;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="col-md-12">
<select class="form-control custom">
<option>AAAAAAAAAAAAAA</option>
</select>
</div>
答案 0 :(得分:1)
您可以使用bootstrap selectpicker自定义选择
.btn {
padding: 20px!important;
}
.dropdown-menu>li>a {
padding: 20px!important;
}
&#13;
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.7.5/css/bootstrap-select.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.7.5/js/bootstrap-select.min.js"></script>
<div class="col-md-12">
<form>
<div class="form-group">
<label for="sel1">Select list (select one):</label>
<select class="selectpicker" data-style="btn-primary" multiple data-max-options="2">
<option>AAAAAAAAAAAAAA</option>
</select>
</div>
</form>
</div>
&#13;