Boss, if there is a floating element and an inline block element in the parent box, why does the inline block element avoid the space of the floating element? Instead of occupying its space (the block
element will occupy its space)
code is as follows:
<body>
<div class="box">
<div class="c1"></div>
<div class="c2"></div>
</div>
</body>
.box {
width: 500px;
height: 300px;
}
.c1 {
width: 100px;
height: 100px;
background-color: red;
float: left;
}
.c2{
width: 200px;
height: 200px;
background-color: blue;
display: inline-block;
}
the effect is as follows: