【发布时间】:2013-05-08 16:01:08
【问题描述】:
以下代码在 IE9、FireFox、Chrome 中呈现良好,但在 Safari 中则不行:
.search-choice
{
position: relative;
background-clip : padding-box;
background-image: url('../Design/icon_chosen_close.gif');
background-repeat: no-repeat;
background-position: top 6px right 6px;
}
<ul class="chzn-choices">
<li class="search-choice" id="selLVB_chzn_c_0">
<span>multi1</span><a href=# class="search-choice-close" rel="0"></a>
</li>
</ul>
Safari 似乎没有考虑背景位置。我尝试了许多变体(例如 background-position-x: right 6px),但似乎没有任何效果。我只是无法从右上角开始偏移 Safari 中的背景图像。
有什么想法吗?非常感谢您的宝贵时间!
【问题讨论】:
-
我猜这个
top 6px right 6px不是一个有效值 -
那么有效值应该是多少?它在所有其他浏览器中都能完美运行..
-
试试这个,例如
background-position: 6px 6px;,看看它是否有效 -
对不起,但您的答案的来源是左上角而不是右上角:) 无论如何谢谢
标签: css layout safari background-position