填充不适用于Safari中的选定标签 [英] Padding doesn't work on select tags in Safari
问题描述
可能重复:
在部分Safari和IE中,填充无法正常工作列表
Possible Duplicate:
padding is not working in Safari and IE in select list
所以我有一个基本的选择标签,如下所示:
So I have a basic select tag like so:
<select>
<option>1</option>
<option>2</option>
<option>2</option>
</select>
但是,如果我在select标签上添加了填充,那么它就无法在Safari上运行:
But if I put padding on select tag, it doesn't work on Safari:
select {
padding: 6px;
}
我了解在IE7上,但在Safari上?有办法解决这个问题吗?
On IE7, I understand, but on Safari? Is there a way to get around this?
推荐答案
此处先前解答: https://stackoverflow.com/a /2967371/181002
Webkit已经采取了自己的做法,不允许对select
项进行填充,但是您可以通过使用简单的"hack"来实现相同的效果,其中包括对选择项应用line-height
和text-indent
.
Webkit has taken it upon itself to disallow padding for select
-items, but you can achieve the same effect by using a simple 'hack', consisting of applying line-height
and text-indent
to your selectitem.
这里是一个示例: http://jsfiddle.net/B858P/
这篇关于填充不适用于Safari中的选定标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!