osh*_*nen 1 html css internet-explorer internet-explorer-6
我有以下HTML:
<div id="container">
<div id="header"><h1>Sed sollicitudin dignissim justo, sed.</h1></div>
</div>
Run Code Online (Sandbox Code Playgroud)
和以下CSS:
div#container
{
text-align:left;
width:500px;
margin:0 auto;
}
Run Code Online (Sandbox Code Playgroud)
这将创建一个container横跨整个屏幕的div,以及第一个div header中的另一个div container,其中第二个div具有固定的宽度并且在第一个div中居中.
这在IE6中运行良好,但在IE5.x中,它似乎没有居中,它与屏幕左侧对齐.
我如何在IE5.x中居中?
IE 5.x中心块就像有内联元素一样.
#containers_parent { text-align: center; }
#container { text-align: left; } /* To reset the alignment for the text inside */
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1057 次 |
| 最近记录: |