CSS HTML W3C
It is defined in w3c that elements using float will generate block-level boxes. Isn’t the block level just a line break?#side { height: 192px; float:left; } #main { height:200px; background-color: Aqua; width:600px; }
<div id="side"> <img src="../images/dl.gif" width="192" height="142" alt="" /></div> <div id="main"> </div>
You can refer to this link http://paranimage.com/css-float-attribute/
Block level is not Is it just a line change?
Wrong! Block level means no line breaks
Well, the correct answer upstairs is that float will make the tags break away from the normal flow
If it is good, it is good, but if it is not good, it is not recommended...
You can refer to this link http://paranimage.com/css-float-attribute/
Isn’t the block level just a line break?
Wrong! Block level means no line breaks
Could you please tell me, do block-level boxes and block-level elements have different properties?
For block level, if the sum of the width of the subsequent div and the width of the current div is greater than 100%
it will automatically wrap. Look at your width
I read an article , it is explained that float means that the height of the element does not stretch the parent element, that is, it is ignored when calculating the row height. If all the elements inside the parent element are float, the parent element will collapse to a height of 0. But on the horizontal line, for floats with left and right, they will be floated left and right, but they will not completely break away from the document flow. The occupied position is still there, unlike absolute, which is completely separated from the document flow.