-2
我有DOCTYPE声明的问题,似乎当我添加它,在我的页面上,CSS犯规work.But当我删除的文档类型,一切正常fine.what可能是原因文档类型不工作,因为它应该是
HTML
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css"/>
</head>
<body>
<div id="wrapper">
<div id="header">this is my header
</div>
<div id="center_content">
<div id="left">
</div><div id="right"></div>
</div>
<div id="footer">this is my footer
</div>
</div>
</body>
</html>
CSS
body
{
margin:0px;
padding:0px;
}
#wrapper
{
height:100%;
width:100%
}
#header
{
width:100%;
height:20%;
background-color:red;
}
#center_content
{
min-height:79%;
height:auto;
background-color:pink;
overflow:auto;
}
#footer
{
height:5%;
background-color:blue;
}
#left
{
float:left;
min-height:79%;
height:auto;
width:20%;
background-color:brown;
}
#right
{
float:right;
min-height:79%;
height:auto;
width:79%;
background-color:yellow;
}
Live link?检查您的控制台的错误,也因为您使用的HTML5文档,你不需要设置一个类型的CSS链接 –
我认为你有一个不同的标准“应该”的定义。 – BoltClock
同样使用十六进制/ rgb/rgba而不是红色,粉红色...... –