WuliZhuer
2020-05-20 18:23
完整HTML样式
多定义几个div,应该可以,全部用一个div,上面和下面都在第一个div里面重新定义不同的div,中间的做一个div,中间的在分成三个div,在细分,就可以了,自己去尝试吧。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
body{
}
.div0{
margin: 0 auto;
width: 80%;
background-color: #ccc;
}
.divTop{
height: 200px;
background-color: springgreen;
}
.divCenter{
height: 500px;
background-color: green;
display: flex;
}
.divBottom{
height: 200px;
background-color: springgreen;
}
.divCLeft{
flex: 1;
background-color: yellow;
}
.divCCenter{
flex: 2;
background-color: orange;
}
.divCRight{
flex: 1;
background-color: deeppink;
}
.divCLeft1{
height: 100px;
background-color:red;
}
.divCLeft2{
height: 100px;
background-color: skyblue;
}
.divCLeft3{
height: 100px;
background-color: lawngreen;
}
.divCLeft4{
height: 200px;
background-color: palevioletred;
}
</style>
</head>
<body>
<div class="div0">
<div class="divTop">
</div>
<div class="divCenter">
<div class="divCLeft">
<div class="divCLeft1">
</div>
<div class="divCLeft2">
</div>
<div class="divCLeft3">
</div>
<div class="divCLeft4">
</div>
</div>
<div class="divCCenter">
</div>
<div class="divCRight">
</div>
</div>
<div class="divBottom">
</div>
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
body{
}
.div0{
margin: 0 auto;
width: 80%;
background-color: #ccc;
}
.divTop{
height: 200px;
background-color: springgreen;
}
.divCenter{
height: 500px;
background-color: green;
display: flex;
}
.divBottom{
height: 200px;
background-color: springgreen;
}
.divCLeft{
flex: 1;
background-color: yellow;
}
.divCCenter{
flex: 2;
background-color: orange;
}
.divCRight{
flex: 1;
background-color: deeppink;
}
.divCLeft1{
height: 100px;
background-color:red;
}
.divCLeft2{
height: 100px;
background-color: skyblue;
}
.divCLeft3{
height: 100px;
background-color: lawngreen;
}
.divCLeft4{
height: 200px;
background-color: palevioletred;
}
</style>
</head>
<body>
<div class="div0">
<div class="divTop">
</div>
<div class="divCenter">
<div class="divCLeft">
<div class="divCLeft1">
</div>
<div class="divCLeft2">
</div>
<div class="divCLeft3">
</div>
<div class="divCLeft4">
</div>
</div>
<div class="divCCenter">
</div>
<div class="divCRight">
</div>
</div>
<div class="divBottom">
</div>
</div>
</body>
</html>
初识HTML(5)+CSS(3)-升级版
1225813 学习 · 18234 问题
相似问题