-2
doctype에 문제가 있습니다. 내 페이지에 CSS를 추가 할 때 보이지 않습니다. doctype을 제거하면 모든 것이 올바르게 작동합니다. 이유는 무엇입니까Doctype이 작동하지 않아야합니다.
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;
}
라이브 링크? 당신이 css 링크 –
에 대한 유형을 설정하지 않아도 html5 doctype을 사용하고 있기 때문에 콘솔에서 오류를 확인하십시오. 나는 당신이 표준에서 "should"라는 다른 정의를 가지고 있다고 생각합니다. – BoltClock
빨강, 분홍색 대신 hex/rgb/rgba를 사용하십시오. –