本文介绍了更改下拉菜单的选项高度 - CSS,Javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以使用css?来更改两个选项之间的高度,
请参阅说明。现金与现金之间的高度信用卡选项
请按照图片。
:支持 Chrome 。 strong>只有
回答。
解决方案
>
选项{
padding:5px 0;
}
填充示例
.dis选项{
padding:5px 0;
}
html
$ b b
< select class =dis>
< option> 1erwer< / option>
< option> 2wwerwer< / option>
< option> 3werwer< / option>
< option> 4werwer< / option>
< option> 5wrwer< / option>
< / select>
增加两个选项之间的空格是不可能的
< select class =dis>
< option> 1erwer< / option>
< option> 2wwerwer< / option>
< option> 3werwer< / option>
< option disabled =disabled>< / option> < --- trick
< option> 3werwer< / option>
< / select>
Is that possible to change height between two options using css?,
See the illustrative ex. Height between Cash & Credit Card option
Please follow the image.
Note: Am supporting Chrome only
Regards.
解决方案
try this
option{
padding:5px 0;
}
Example with padding Jsfiddle
.dis option{
padding:5px 0;
}
html
<select class="dis">
<option>1erwer</option>
<option>2wwerwer</option>
<option>3werwer</option>
<option>4werwer</option>
<option>5wrwer</option>
</select>
increasing the space between two options is not possible
<select class="dis">
<option>1erwer</option>
<option>2wwerwer</option>
<option>3werwer</option>
<option disabled="disabled" ></option> <---trick
<option>3werwer</option>
</select>
这篇关于更改下拉菜单的选项高度 - CSS,Javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!