批改状态:未批改
老师批语:
<!DOCTYPE html>
<html>
<head>
<title>双飞翼布局</title>
<meta charset="utf-8">
<style>
.head {
width: 100%;
height: 50px;
background-color: #f00;
}
/* 第一步设置主体容器总宽度,并居中 */
.content {
width: 1000px;
margin: 5px auto;
min-height: 300px;
background-color: aqua;
}
/* 第二步左右两侧固定宽度,中间区块自适应 */
.wrap {
width: inherit;
min-height: inherit;
background-color: bisque;
}
.wrap .main{
padding: 0 200px;
}
/* 设置左右区块的宽度和高度(因为无内容,所以设置了最小高度),并设置参考色块 */
.left{
width: 200px;
min-height: 300px;
background-color: blue;
margin-left:-100%;
}
.right{
width: 200px;
min-height: 300px;
background-color:blueviolet;
margin-left: -200px;
}
.wrap,.left,.right{
float: left;
}
.foot{
width: 100%;
height: 100px;
background-color: black;
}
</style>
</head>
<body>
<div class="head"></div>
<!-- 双飞翼布局 -->
<div class="content">
<!-- 双飞翼dom结构 -->
<div class="wrap">
<!-- 主体必须放到wrap中 -->
<div class="main">main</div>
</div>
<div class="left">left</div>
<div class="right">right</div>
</div>
<div class="foot"></div>
</body>
</html>
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号