- Everyone knows that blocks and inline-block elements such as height=contentheight at least in Firefox, but if a block-level element is not set to Height, then the element's height= ( The size of the child element (Content+padding+margin)), but the element with the positional attributes (fixed and absolute) and the float element is not within the above calculation range, but there is also a positional property-relative, If you specify the top property of the relative element, such as style= ' top:10px;position:relatve;height:90px ', the height of the unspecified parent element is equal to 90px (excluding the Top property, That is, the height of the child element box model), so that it seems that relatively positioned elements can go beyond the boundaries of the parent element, which is no problem.
- For overflow, as long as the non-absolute positioning and fixed positioning elements, if set Overflow=scroll, then the above relative elements can be considered out of bounds, you will see a vertical scroll bar, for more general situation, do not elaborate.
- Afraid to forget, record it again
Overflow and height calculation of elements in HTML