webveuje/teaching/lhj/kejian/float.html
2021-04-29 17:16:40 +08:00

91 lines
2.8 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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>