我正在使用此代码来创建我的网站的布局。我的问题是“左”和“右” div 没有显示在屏幕上。(当我将它们的高度设置为像素而不是百分比时,它们会显示)我该怎么做才能显示
<!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">
<head>
<title>Test</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<style type="text/css" media="screen">
* {
margin: 0;
}
html,
body {
height: 100%;
}
#wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -44px; /* -44px being the size of the footer */
}
#header {
height: 86px;
}
#footer,
#push {
height: 44px;
}
#left
{
width:8px;
width:100%;
background-color:blue;
float:left;
}
#right
{
width:8px;
width:100%;
background-color:blue;
float:right;
}
#left: first,
#right: first,
{
content: "";
height: 0;
clear: both;
display: block;
}
</style>
</head>
<body>
<div id="wrapper">
<div id="header">header</div>
<div id="content">
<div id="left"></div>
content
<div id="right"></div>
</div>
<div id="push"></div>
</div>
<div id="footer">footer</div>
</body>
</html>