css - IE中的网站位置错误

标签 css

有问题的网站是DCWB

忘记概述问题

基本上一切在 FF 中看起来都很好,但是当我在 IE 中查看时,大多数 DIV 的位置都是错误的。

*

有人可以帮忙解决这个问题吗?

body {
    background-color:#000;
    font-size:8px;
    font-family:Arial, Helvetica, sans-serif;
    font-size:10px;
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
    text-align: center;
    color:#FFF;
    overflow-y:scroll;
}
#header {
    background-color: #900;
    position:fixed;
    width:100%;
    height:50px;
    left: 0px;
    top: 0px;
}
#apDiv1 {
    visibility:hidden;
    position:fixed;
    width:34px;
    height:114px;
    left: 0px;
    top: 100px;
}
#pic{
    width: 108px;
    right: 10px;
    top: 150px;
    position: fixed;
}
#facebook {
    width: 34px;
    left: 0px;
    top: 100px;
    position: fixed;
}
#Twitter {
    width: 34px;
    left: 0px;
    top: 200px;
    position: fixed;
}
#Menu {
    background-color:#900;
    color:#FFF;
    font-size:12px;

}
#content {
    width:800px;
    position:absolute;
    text-align:center;
    left: 50%;
    top:44px;
    margin-left: -400px;
    font-size: 10px;
    font-weight: bold;
}
table tr td #Menu tr td p {
    font-size: 12px;
}
table tr td table tr td strong {
    font-size: 12px;
}
a:link {
    color: #FFF;
    text-decoration: none;
}
a:visited {
    text-decoration: none;
    color: #FFF;
}
a:hover {
    text-decoration: none;
    color: #FFF;
}
a:active {
    text-decoration: none;
    color: #FFF;
}

最佳答案

在您的代码中没有 DOCTYPE声明,这使 IE 在 quirks mode 中运行.在您的 html 页面的开头添加以下内容:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

关于css - IE中的网站位置错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4133304/

相关文章:

html - margin-bottom 在 flexbox 中不起作用

HTML, Bootstrap 3 : curved bottom brand navbar

html - 使用 col-push 和 col-pull bootstrap 定位元素 3

css - 隐藏垂直滚动条但仍然滚动 Firefox/IE/Edge

html - 增加 HTML 按钮字体大小而不改变按钮大小

css - 如何更改 angularjs angular-material 内部 SASS !default 变量?

javascript - 动画 HTML 背景图像淡入淡出

html - 响应式文本

html - 当我调整浏览器窗口大小时,它会覆盖我的幻灯片内容 - Bootstrap

css - :Host CSS equivalent for VueJS Templates?