Prototypr Logo

30 Seconds of CSS A curated collection of useful CSS snippets you can understand in 30 seconds or le…

medium bookmark / Raindrop.io |

Clearfix

Ensures that an element self-clears its children.

Note: This is only useful if you are still using float to build layouts. Please consider using a modern approach with flexbox layout or grid layout.

HTML

<div class="clearfix"> 
  <…