更改下拉菜单的选项高度 - CSS,Javascript [英] Change the Option height of dropdown - CSS, Javascript

查看:116
本文介绍了更改下拉菜单的选项高度 - CSS,Javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用css?来更改两个选项之间的高度,



请参阅说明。现金与现金之间的高度信用卡选项



请按照图片。



:支持 Chrome strong>只有



回答。

解决方案

>

 选项{

padding:5px 0;
}

填充示例 Jsfiddle

  .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

but there is a tricky way

<select class="dis">
  <option>1erwer</option>
  <option>2wwerwer</option>
  <option>3werwer</option>
  <option disabled="disabled" ></option> <---trick 
  <option>3werwer</option>
</select>

这篇关于更改下拉菜单的选项高度 - CSS,Javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆