CSS 如何在选择输入中的选项之间添加填充?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10825332/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 04:02:35  来源:igfitidea点击:

How to add padding between options in select input?

css

提问by Ahmed Fouad

How to add padding to my select input options? Here is my CSS and all options seem below each other without any spacing (in terms of height of option) I have a CSS reset.. aside from that how can I give the options a bit of height to make it look good?

如何向我选择的输入选项添加填充?这是我的 CSS,所有选项似乎都低于彼此,没有任何间距(就选项的高度而言)我有一个 CSS 重置..除此之外,我如何给选项一点高度以使其看起来不错?

.upload-input select {
    display: block;
    font-size: 14px;
    color: #888;
    width: 616px;
    background: #fff;
    border: 1px solid #ccc;
}

Update

更新

I applied the suggested css. It does not look right.

我应用了建议的css。它看起来不对。

enter image description here

在此处输入图片说明

采纳答案by Timbadu

Try

尝试

.upload-input select option { padding: 6px;}

You might have to fiddle with the .upload-input select css though.

不过,您可能需要摆弄 .upload-input 选择 css。

Like:

喜欢:

.upload-input select {height: 35px;}