簡體   English   中英

如何使此按鈕圖像在Firefox 2.0中與在IE7中相同?

[英]How can I make this button image appear in Firefox 2.0 the same as it does in IE7?

我在下面定義了我的錨鏈接的CSS文件。 這對於IE7來說效果很好,但是當我在Firefox中打開頁面時,按鈕圖像會更長。

我用Google搜索了一下,看看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 as按鈕為:

    <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. 在Firefox中使用max-width限制按鈕的寬度(除非您在DTD中聲明“ XHTML 1.0 Strict”,否則Internet Explorer 7不了解此屬性)。

  3. 看看是否有任何div /表格/其他元素正在影響按鈕的大小。

  4. 檢查邊距/邊框/填充屬性是否有影響。

  5. 開始一個干凈的頁面並從頭開始構建問題,以查看是否可以重新創建問題。 (在上面的示例中,您正在進行很多工作,也許您需要提煉自己的想法。)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM