CSS grid and flexbox are now becoming a more popular way to create page layouts. However, floats are still commonly used, especially when working with an older code base, or it you need to support older browser version. What are two valid techniques used to clear floats?

  • Use the “clearfix hack” on the floated element and add a float to the parent element.
  • Use the overflow property on the floated element or the “clearfix hack” on either the floated or parent element.
  • Use the “clearfix hack” on the floated element or the overflow property on the parent element.
  • Use the “clearfix hack” on the parent element or use the overflow property with a value other than “visible.”
Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Leave a Comment

Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Send this to a friend