Well presented tutorial on floats; thank you. One question, when one uses floats, isn't good practice to clear the floats at end of the container div, in your case the "info_section div"? As I recall, there are number of methods and hacks for clearing floats. What is your preferred method?
Yes, exactly. If the parent contains mostly or all floating children, a clear fix is often useful. I tend to put overflow: hidden on the parent. That allows the parent's height to adjust and accommodate the height of the floating blocks. If overflow: hidden causes some other issues (like with positioned elements), then I'll go to a clear: both on some element that follows the floating elements.
This is one area I struggle to remember how to do - CONSTANTLY! Yours was the best tutorial I've seen to date, clear, concise and to the point!
I like the way you explain things. So calmly but on point. Thank You.
Agree. Good pace too 🙂
Well presented tutorial on floats; thank you. One question, when one uses floats, isn't good practice to clear the floats at end of the container div, in your case the "info_section div"? As I recall, there are number of methods and hacks for clearing floats. What is your preferred method?
Yes, exactly. If the parent contains mostly or all floating children, a clear fix is often useful.
I tend to put overflow: hidden on the parent. That allows the parent's height to adjust and accommodate the height of the floating blocks.
If overflow: hidden causes some other issues (like with positioned elements), then I'll go to a clear: both on some element that follows the floating elements.