这是我的css + html。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
<title>One Hundred Percent height divs</title>
<style type="text/css" media="screen">
html
{
height:100%;
}
body
{
margin:0;
padding:0;
height:100%;
}
header
{
height:20px;
width:100%;
background-color:red;
}
.container2
{
height:40px;
width:100%;
background-color:#11ccdd;
}
.container3
{
height:35%;
width:100%;
background-color:#bacdef;
}
.subcontainer1
{
float:left;
height:35%;
width:50%;
background-color:#569895;
}
.subcontainer2
{
float:left;
height:35%;
width:50%;
background-color:#dbc462;
}
.container4
{
width:100%;
background-color:#aaaadd;
}
</style>
</head>
<body>
<header>
header
</header>
<div class="ClearAll"></div>
<div class="container2">
container2
</div>
<div class="ClearAll"></div>
<div class="container3">
<div class="subcontainer1">
subcontainer1
</div>
<div class="subcontainer2">
subcontainer2
</div>
</div>
<div class="ClearAll"></div>
<div class="container4">
container4
</div>
</body>
</html>
我需要提到前两个div的宽度像素值,正如我在这里写的那样。 第三个容器具有宽度的百分比值。第四个容器应占据其余三个div所剩余的空间(屏幕大小)。我怎么能给那个..