我有一个页脚DIV
<div id=footer">
内部
<div id="wrapper">
我已经将 width: 100%
和 text-align:center
设置为 footer
...它在 chrome 上工作正常、IE 9、8 和 Firefox。
但在 IE 7 中它不起作用,我不得不使用 margin
来正确对齐它。
请帮忙。
//这适用于 Chrome,IE 9,IE 8,FF
#footer .footertc {
text-align: center;
margin: 35px 0px 0px 0px;
display: block;
width: 100%;
height: 75px;
background: #F1F1EF;
padding: 0px;
font-size: 10px;
clear: both;
}
#wrapper {
background: white;
background-position: 50% 0px;
width: 984px;
margin: 0px auto 0 auto;
text-align: center;
}
//这是针对 IE 7 的 --> 我被迫使用 margin-left
*+html #footer .footertc {
text-align:center; -> this does not work
margin:50px 0px 0px 550px;
display:block;
width:100%; --> this does not work
height:75px;
background:#F1F1EF;
}
最佳答案
您可以尝试使用 reset.css 来最小化跨浏览器的 css 问题。 更多详情可以看here.
关于css - DIV 宽度 :100% and text-align: center dows not work in IE 7 - need IE 7 CSS hack,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11332334/