A very good little tip I saw accidentally. It’s about using CSS to handle closed floating elements. I collected it.
There are many methods for closing floating elements (clearing float). You still haven’t. If you know more about it, check out old9’s blog. There is an article about closing floating elements.
My favorite of these methods is to use the :after pseudo-class to dynamically embed an element for clearing floating elements. Unfortunately, the amount of code is too large and it doesn’t look concise enough. Now I see there is a super simple method. Let me introduce it quickly. The original text is at: http://annevankesteren.nl/2005/03/clearing-floats
The principle is this. The reason why peripheral elements cannot be extended well is the overflow. on, because the overflow is not visible. See W3C’s explanation