-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而不是紅色,粉紅色...... –