【问题标题】:ie9 css issue with tbody widthtbody宽度的ie9 css问题
【发布时间】:2014-04-01 13:09:29
【问题描述】:

在 IE9 中,宽度似乎没有应用于我的 tbody,见下文和this fiddle

    <table>
    <tbody>
    <tr>
    <td class="label"><label for="l_name">Name</label>:</td>
    <td class="value"><input type="text" name="l_name" value="" id="l_name"></td>
    </tr>
    </tbody>
    </table>

    <style>
        table {
            background: none repeat scroll 0 0 #FFFFFF;
            text-align: center;
            width: 100%;
        }

        tbody {
            background: none repeat scroll 0 0 red;
            display: inline-block;
            width: 360px;
        }
    </style>

我在这里做错了什么?

【问题讨论】:

    标签: html css internet-explorer internet-explorer-9


    【解决方案1】:

    尝试使用有效的文档类型,例如 &lt;!DOCTYPE HTML&gt;

    <!DOCTYPE HTML>
    <style>
    table {
                background: none repeat scroll 0 0 #FFFFFF;
                text-align: center;
                width: 100%;
            }
    
            tbody {
                background: none repeat scroll 0 0 red;
                display: inline-block;
                width: 360px;
            }
    </style>
    

    【讨论】:

    • 感谢您的反馈,我的小提琴和本地主机上的测试站点已经有了这个
    猜你喜欢
    • 2012-10-01
    • 1970-01-01
    • 2013-11-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多