【问题标题】:IE8 alignment in div issuediv问题中的IE8对齐
【发布时间】:2010-05-01 04:35:19
【问题描述】:

如何在 IE8 中对齐 div 中心的按钮。在 IE7 中运行良好,但在 IE8 中无法运行

<div id="dPopupFooter" style="background-color: #d9d9d9; position: absolute; z-index: 5;
bottom: 0px; width: 100%; height: 30px; border-top: solid 1px #acacac; text-align: center; padding-top: 3px;">

            <table><tr><td><xrx:CustomButton id="btnClose"  runat="server" OnClientClick="ClosePopup();" /></td></tr></table>           

    </div>

【问题讨论】:

    标签: css html


    【解决方案1】:

    CSS(在样式块或样式表中):

    #dPopupFooter table tr td {
    
    text-align: center;
    
    }
    

    是的,它有效,只是你看不到它。问题是您的表格没有 100% 的宽度:

    #dPopupFooter table {
        width:100%
    }
    

    【讨论】:

    • 您好,我已经给出了上面提到的 css,但是按钮宽度延伸到整个 div 部分。
    • 将其设置为像素值而不是 100%
    • 是的,我给出了像素值,但按钮是从左到右扩展而不是中心对齐
    猜你喜欢
    • 2013-08-30
    • 1970-01-01
    • 2014-12-23
    • 1970-01-01
    • 1970-01-01
    • 2018-04-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多