Clearfix with different layout classes

/ Published in: CSS
Save to your folder(s)

Clearfix with 2 different classes: page, section

Section: takes up a whole row (much like TR);
Page: is the container for each section

Copy this code and paste it in your HTML
  1. .clearfix:after, .section:after, .page:after{content:"."; display:block; clear:both; visibility:hidden; line-height:0; height:0} .clearfix, .section, .page{display:inline-block} html[xmlns] .clearfix, html[xmlns] .section, html[xmlns] .page{display:block} * html .clearfix, * html .section, * html .page{height:1%}
  3. .section { width: 100% }
  4. .page { /* DEFINE WIDTH */

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.