css - DIV 宽度 :100% and text-align: center dows not work in IE 7 - need IE 7 CSS hack

标签 css html

我有一个页脚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/

相关文章:

CSS 获取当前 <td> 的 <th>?

html - 我们可以从 Angular 应用程序中排除 tsconfig.spec.json

javascript - noscript 中的重复 id

css禁用div中的滚动

带有事件处理程序的 JavaScript 变量范围

jquery - 调整表格单元格中一个或多个 <span> 的高度

html - 非常简单的 CSS 站点

html - 如何显示没有下划线的超链接?

html - 访问嵌套的 html 元素并设置它们的 css

php - chrome 中的类属性困惑