abstract:<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0">&
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="E:\front\boxfudong.css">
</head>
<body>
<div class="box"></div>
<div class="box1"></div>
<div class="box2"></div>
<div class="box3"></div>
</body>
</html>
--------------------------------------------
.box{
width: 200px;
height:200px;
background-color:black;
/* float: left; /*向左浮動(dòng)*/
position: relative; /*相對(duì)定位*/
left: 200px;
}
.box1{
width: 200px;
height:200px;
background-color: blue;
/* float: right*/
position: relative;
left: 300px;
}
.box2{
width: 200px;
height:200px;
background-color: chartreuse;
/* clear: both; /*清除浮動(dòng)對(duì)其的影響*/
position: relative;
left: 400px;
}
.box3{
width: 200px;
height:200px;
background-color: lightblue;
/* clear: both; /*清除浮動(dòng)對(duì)其的影響*/
position: relative;
left: 500px;
}
Correcting teacher:韋小寶Correction time:2019-02-21 17:27:39
Teacher's summary:css中的浮動(dòng)相當(dāng)重要 但是使用多了也有可能會(huì)照成布局混亂 要記得清除浮動(dòng)哦!