如何在Firefox 2.0中显示此按钮图像与在IE7中一样?

时间:2009-07-08 07:54:51

标签: css firefox2

我有一个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"/>

1 个答案:

答案 0 :(得分:1)

如果我正确理解了问题,那么按钮的宽度在IE和Firefox中的显示方式不同。以下是您可以尝试的一些事项:

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

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

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

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

  5. 启动一个干净的页面,从头开始构建问题,看看是否可以重新创建问题。 (你上面的例子中有很多事情要做,你可能需要提炼自己的想法。)

相关问题