练习
This commit is contained in:
91
teaching/lhj/kejian/float.html
Normal file
91
teaching/lhj/kejian/float.html
Normal file
@@ -0,0 +1,91 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
<style>
|
||||
*{
|
||||
margin:0;
|
||||
padding: 0;
|
||||
}
|
||||
.pic{
|
||||
width:200px;
|
||||
height: 200px;
|
||||
background: red;
|
||||
/* display: inline-block; */
|
||||
float: left;
|
||||
}
|
||||
.box{
|
||||
width: 600px;
|
||||
overflow:auto;
|
||||
/* display: inline-block; */
|
||||
}
|
||||
.pic2{
|
||||
width:200px;
|
||||
height: 200px;
|
||||
background: blue;
|
||||
/* display: inline-block; */
|
||||
float: left;
|
||||
}
|
||||
.pic3{
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
background: green;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.topDiv {
|
||||
width: 500px;
|
||||
padding: 4px;
|
||||
border: 2px solid black;
|
||||
overflow: auto;
|
||||
}
|
||||
.floatDiv {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
border: 2px dotted red;
|
||||
color: red;
|
||||
margin: 4px;
|
||||
float: left;
|
||||
}
|
||||
.bottomDiv {
|
||||
width: 500px;
|
||||
height: 100px;
|
||||
margin: 5px 0;
|
||||
border: 2px dotted black;
|
||||
}
|
||||
.textDiv {
|
||||
color: blue;
|
||||
border: 2px solid blue;
|
||||
}
|
||||
.boxes{
|
||||
/* overflow: auto; */
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="box">
|
||||
<div class="pic"></div>
|
||||
<div class="pic2"></div>
|
||||
<!-- <div>抛开浮动的破坏性先不谈,浮动就是个带有方位的display:inline-block的属性。
|
||||
display:inline-block 某种意义上的作用就是包裹,浮动也有类似的效果抛开浮动的破坏性先不谈,浮动就是个带有方位的display:inline-block的属性。
|
||||
display:inline-block 某种意义上的作用就是包裹,浮动也有类似的效果抛开浮动的破坏性先不谈,浮动就是个带有方位的display:inline-block的属性。
|
||||
display:inline-block 某种意义上的作用就是包裹,浮动也有类似的效果抛开浮动的破坏性先不谈,浮动就是个带有方位的display:inline-block的属性。
|
||||
display:inline-block 某种意义上的作用就是包裹,浮动也有类似的效果抛开浮动的破坏性先不谈,浮动就是个带有方位的display:inline-block的属性。
|
||||
display:inline-block 某种意义上的作用就是包裹,浮动也有类似的效果</div> -->
|
||||
<!-- <div style="clear:both ;"></div> -->
|
||||
<div class="pic3">
|
||||
|
||||
</div>
|
||||
<div class="topDiv">
|
||||
<div class="floatDiv">float left</div>
|
||||
<div class="textDiv">...</div>
|
||||
<div class="pic2"></div>
|
||||
</div>
|
||||
<div class="bottomDiv">...</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user