批改状态:合格
老师批语:
总结后补
双飞翼布局代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>双飞翼布局</title>
<style type="text/css">
.box1,.box2 {
width: 100%;
height: 50px;
background-color: #F8F8FF;
}
.hd {
width:800px;
height: 100%;
background-color: #D3D3D3;
margin:auto;
}
.box3 {
width: 800px;
background-color: yellow;
margin:auto;
overflow: hidden;
}
.con {
width:100%;
float: left;
}
.main {
height: 600px;
margin:0 100px;
}
.left,.right {
width:100px;
height: 600px;
float: left;
}
.left {
margin-left: -100%;
background-color: red;
}
.right {
margin-left: -100px;
background-color: red;
}
.box2 {
clear:both;
}
</style>
</head>
<body>
<!-- 头部 -->
<div class="box1">
<div class="hd">头部</div>
</div>
<!-- 主体 -->
<div class="box3">
<div class="con">
<div class="main">中间</div>
</div>
<div class="left">左侧</div>
<div class="right">右侧</div>
</div>
<!-- 底部 -->
<div class="box2">
<div class="hd">底部</div>
</div>
</body>
</html>点击 "运行实例" 按钮查看在线实例
圣杯布局代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>圣杯布局</title>
<style type="text/css">
.box1,.box2 {
width: 100%;
height: 50px;
background-color: #F8F8FF;
}
.hd {
width: 800px;
height: 100%;
background-color: #D3D3D3;
margin: auto;
}
.box2 {
clear:both;
}
.box3 {
width: 600px;
margin:auto;
padding: 0 100px;
}
.middle {
width: 100%;
height: 600px;
float: left;
background-color: yellow;
}
.left,.right {
width: 100px;
height: 600px;
float: left;
background-color: red;
position: relative;
}
.left {
margin-left: -100%;
left:-100px;
}
.right {
margin-left: -100px;
right:-100px;
}
</style>
</head>
<body>
<!-- 头部 -->
<div class="box1">
<div class="hd">头部</div>
</div>
<!-- 主体 -->
<div class="box3">
<div class="middle">中间</div>
<div class="left">左侧</div>
<div class="right">右侧</div>
</div>
<!-- 底部 -->
<div class="box2">
<div class="hd">底部</div>
</div>
</body>
</html>点击 "运行实例" 按钮查看在线实例
效果图后补
手抄代码

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号