选择在Chrome中无法使用的选项填充 [英] Select option padding not working in chrome

查看:223
本文介绍了选择在Chrome中无法使用的选项填充的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

选择不能在Chrome中使用的选项填充

Select option padding not working in chrome

<style>
select option { padding:5px 0px; }
</style>    
<select>
<option>1</option>
<option>2</option>
<option>3</option> 
</select>


推荐答案

我刚刚找到一种方法,在chrome中选择输入

I just found a way to get padding applied to the select input in chrome

select{
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding: 5px;
}

似乎可以在目前的Chrome 39.0.2171.71(64位) safari(我只是在mac上测试这个)。

Seems to work in the current chrome 39.0.2171.71 (64-bit) and safari (I only tested this on a mac).

这似乎删除了添加到选择输入的默认样式(它也删除了下拉箭头),但允许

This seems to remove the default styling added to the select input (it also removed the drop down arrow), but allows you to then use your own styling without chrome overriding it.

我在使用这里的代码时发现了这个问题:http://fettblog.eu/style-select-elements/

I stumbled across this fix while using code from here: http://fettblog.eu/style-select-elements/

这篇关于选择在Chrome中无法使用的选项填充的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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