css - 如何使这个按钮图像在 Firefox 2.0 中的显示与在 IE7 中的显示相同?

标签 css firefox2

我的 anchor 链接有一个 CSS 文件,定义如下。这适用于 IE7 但当我打开 Firefox 中的页面按钮图像较长。

我用谷歌搜索 Firefox 是否有后台位置错误,但没有找到任何东西。

我该如何解决这个问题?

CSS 文件如下:

/* button settings */
a.RadForm_CustomSkins, a.RadForm_CustomSkins span
{
    background-image: url('FormDecorator/ButtonSprites.gif');
    background-repeat:no-repeat;
    cursor:hand;
    cursor:pointer;
    display:inline-block;
}

a.RadForm_CustomSkins.rfdInputDisabled:hover
{
    background-position: 0% 0%;
}

a.RadForm_CustomSkins .rfdInner,
a.RadForm_CustomSkins.rfdInputDisabled:hover .rfdInner
{
    margin-right: 11px;
    margin-left: 11px;
    background-position: 0 -21px;
    color: #ffffff;
    font-size:11px;
}

a.RadForm_CustomSkins.rfdInputDisabled:hover .rfdOuter
{
    background-position: right 0%;
}

a.RadForm_CustomSkins:hover
{
    background-position: 0 -42px;
}

a.RadForm_CustomSkins:hover .rfdInner
{
    background-position: 0 -63px;
    color: #ffffff;
}

a.RadForm_CustomSkins:hover .rfdOuter
{
    background-position: right -42px;
}
/* end of button settings */

/* clicked button styles */
a.RadForm_CustomSkins.rfdClicked
{
    background-image: url('FormDecorator/ButtonSprites.gif');
    background-position: 0 -84px;
    background-repeat: no-repeat;
}

a.RadForm_CustomSkins.rfdClicked span
{
    background-image: url('FormDecorator/ButtonSprites.gif');
}

a.RadForm_CustomSkins.rfdClicked .rfdInner
{
    background-position: 0 -105px;
    background-repeat: repeat-x;
    color: #ffffff;
}

a.RadForm_CustomSkins.rfdClicked .rfdOuter
{
    background-position: right -84px;
    background-repeat: no-repeat;
}
/* end of clicked button styles */

/* do NOT change these settings, otherwise the skinned buttons will be broken when used within a decoration zone */
a.rfdSkinnedButton.RadForm_CustomSkins
{
    -moz-user-select: none !important;
    outline: none !important;
    text-decoration: none !important;
    cursor: default !important;
    text-align: center !important;
    background-color: transparent !important;
    border: 0 !important;
    display: inline-block !important;
    background-position: 0% 0%; 
}

作为按钮呈现的 HTML 是:

    <a id="_rfdSkinnedctl00_signOut" class="rfdSkinnedButton RadForm_CustomSkins" href="javascript:void(0)" style="width: 80px;">
<span class="rfdOuter">
<span class="rfdInner">Çıkış</span>
</span>
</a>
<input id="ctl00_signOut" class="rfdRealButton" type="submit" value="Çıkış" name="ctl00$signOut" _rfddecoratedid="_rfdSkinnedctl00_signOut"/>

最佳答案

如果我没有理解错的话,就是按钮的宽度在IE和Firefox中显示的不一样。您可以尝试以下操作:

  1. 明确设置按钮的宽度。

  2. 使用 max-width 来限制 Firefox 中按钮的宽度(IE7 不理解此属性,除非您在 DTD 中声明“XHTML 1.0 Strict”)。

  3. 查看是否有任何 div/tables/其他元素影响了按钮的大小。

  4. 检查边距/边框/填充属性是否有影响。

  5. 从一个干净的页面开始,从头开始解决问题,看看是否可以重现问题。 (你在上面的例子中有很多事情要做,你可能需要提炼你的想法。)

关于css - 如何使这个按钮图像在 Firefox 2.0 中的显示与在 IE7 中的显示相同?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1096684/

相关文章:

css - CSS 中字母之间的垂直线是什么?

php - 将 HTML 模板与 Wordpress PHP 文件混合

javascript - 仅向单击的元素及其子元素添加类

html - 并排对齐两个div

css - Firefox 1.5 和 2 css 绝对位置错误

javascript - 如何根据显示的用户文本禁用输入字段?

javascript - 操作输入字段

javascript - 控制切换状态

javascript - 如何根据页面其他地方的文本停止某些输入值?