开发者社区> 问答> 正文

在IE7下显示正常,其他不正常?

代码如下:

<!DOCTYPE html>
<html>
<head>
<meta charset="GBK"/>
<title></title>
<style>
body, ul, li, div {
padding: 0;
margin: 0;
}

ul {
list-style: none;
}

#center {
margin: 20px auto;
width: 600px;
height: 600px;
}

#nav {
float: left;
width: 100px;
height: 600px;
}

#nav li {
width: 100px;
font-size: 24px;
line-height: 100px;
border:1px solid black;
}

#center div {
position: relative;
right:0;
width: 500px;
height: 500px;
text-align:center;
font-size: 30px;
line-height: 500px;
}

#d1 {
top: 0;
background: #ff0000;
}

#d2 {
top: 500px;
display:none;
background: #0000ff;
}

#d3 {
top: 500px;
display:none;
background: #00ffff;
}

#d4 {
top: 500px;
display:none;
background: #00ff00;
}

</style>
</head>
<body>


<div id="center">
<ul id="nav">
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
</ul>
<div id="d1">div1</div>
<div id="d2">div2</div>
<div id="d3">div3</div>
<div id="d4">div4</div>
</div>


<script></script>
</body>
</html>

IE7下效果图(正常):
screenshot

展开
收起
杨冬芳 2016-06-15 11:08:27 1959 0
0 条回答
写回答
取消 提交回答
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载