填充不上的Safari选择标签工作 [英] Padding doesn't work on select tags in Safari
问题描述
可能重复:结果
<一href=\"http://stackoverflow.com/questions/2966855/padding-is-not-working-in-safari-and-ie-in-select-list\">padding是不是在Safari和IE工作在选择列表
所以我有一个基本的选择标记,像这样:
So I have a basic select tag like so:
<select>
<option>1</option>
<option>2</option>
<option>2</option>
</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?
推荐答案
回答previously这里:的http://计算器。 COM / A /十八万一千零二分之二百九十六万七千三百七十一
Answered previously here: http://stackoverflow.com/a/2967371/181002
的Webkit已独自去禁止填充为选择
-items,但你可以通过一个简单的黑客达到同样的效果,包括应用的行高
和文本缩进
您选择信息。
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屋!