Skip to content

Instantly share code, notes, and snippets.

@Takazudo
Forked from kotarok/my clearfix
Created May 13, 2011 01:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Takazudo/969835 to your computer and use it in GitHub Desktop.
Save Takazudo/969835 to your computer and use it in GitHub Desktop.
the clearfix I'm currently using
/* kotaroclearfix */
.clearfix { *zoom: 1; }
.clearfix:after { content: ''; display: block; clear : both; height: 0; }
@media print { .clearfix:after { height: 1px; margin-bottom: -1px; visibility: hidden; } }
@hail2u
Copy link

hail2u commented May 13, 2011

display: table; にすると height プロパティが不要になって短くなるとか何とか最近どっかで見ました。

@Takazudo
Copy link
Author

お、ありがとございます!
なんかdisplay:tableにすると、幅がshrink-to-fitになってしまいそうなのですがちと今度試してみます〜

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment