float floating height will collapse parent element, parent element can not be softened, resulting in background color can not be softened
Solution:
- Set the height of the parent element
- The parent element is set overflow: hidden Clear float
- The parent element is also set to the floating float
- Add the code before the end tag: <div style = "clear: both"> </ div>