+ -
当前位置:首页 → 问答吧 → [已解决]首页部分无法居中,火狐,谷歌浏览器都正常,就IE不行?

[已解决]首页部分无法居中,火狐,谷歌浏览器都正常,就IE不行?

时间:2010-09-17

来源:互联网

网址是:http://u.90tao.com

css就在首页源码中,
复制内容到剪贴板
代码:
<style>
body {
    background:#F3FAFD;
    color:#5B87B4;
    font:16px/30px verdana,arial,sans-serif;
}
h1 {text-align:center}
h2 {border-bottom:1px solid white;}
#container {
    width: 780px;
    margin:0 auto;
    background-color: #fff;
    border: 2px solid #2A85B3;
    padding: 10px;
    margin-top: -13px;
    -moz-border-radius:15px;
    -webkit-border-radius:15px;
}
#footer {
    text-align:center;
    margin-top:20px;
}
#footer p {
    padding:5px;
    background:white;
    margin:0 auto;
    width:750px;
    -moz-border-radius:10px;
    -webkit-border-radius:10px;
    border:1px solid #2A85B3;
    -moz-border-radius-bottomleft:35px;
    -moz-border-radius-bottomright:35px;
    -webkit-border-bottom-left-radius:25px;
    -webkit-border-bottom-right-radius:25px;
}
#footer p a {
    background:#fff url(http://yourls.org/images/favicon.gif) 2px center no-repeat;
    padding-left:20px;
}
div#copybox { width:600px}
div#sharebox {height:auto; width:600px; margin-top: 20px}
</style>
问题好像出在#container 中,但是怎么修改,就是不居中。

[ 本帖最后由 martian07 于 2010-9-17 09:24 编辑 ]

作者: martian07   发布时间: 2010-09-17

页面一定要有doctype

作者: maomidog   发布时间: 2010-09-17

没有DTD声明

作者: geminids   发布时间: 2010-09-17

非常感谢二位,问题解决了。

作者: martian07   发布时间: 2010-09-17