Read more

CSS has a built-in clearfix

Henning Koch
August 05, 2021Software engineer at makandra GmbH

The need for clearfix hacks Show archive.org snapshot has been greatly reduced since we could layout with Flexbox or CSS Grid.

Illustration book lover

Growing Rails Applications in Practice

Check out our e-book. Learn to structure large Ruby on Rails codebases with the tools you already know and love.

  • Introduce design conventions for controllers and user-facing models
  • Create a system for growth
  • Build applications to last
Read more Show archive.org snapshot

However, when you do need a clearfix, there's no reason to use a hack anymore. You can just give the clearing container display: flow-root Show archive.org snapshot .

This is supported by all browsers except IE11 Show archive.org snapshot .

Posted by Henning Koch to makandra dev (2021-08-05 13:03)