960 grid clearfix vs HTML5 Boilerplate ist clearfix - Was ist der Unterschied?

960 grid clearfix vs HTML5 Boilerplate ist clearfix - Was ist der Unterschied?

Hier ist die clearfix gefunden in Nathan Smith 960 grid css:

/* http://www.yuiblog.com/blog/2010/09/27/clearfix-reloaded-overflowhidden-demystified */

.clearfix:before,
.clearfix:after {
  content: '\0020';
  display: block;
  overflow: hidden;
  visibility: hidden;
  width: 0;
  height: 0;
}

.clearfix:after {
  clear: both;
}

/*
  The following zoom:1 rule is specifically for IE6 + IE7.
  Move to separate stylesheet if invalid CSS is a problem.
*/

.clearfix {
  zoom: 1;
}

und hier ist die clearfix gefunden bei Paul Irish-HTML5-Boilerplate:

/* The Magnificent Clearfix: Updated to prevent margin-collapsing on child elements.
   j.mp/bestclearfix */

.clearfix:before, .clearfix:after {
    content: "\0020"; 
    display: block; 
    height: 0; 
    overflow: hidden;
}

.clearfix:after { clear: both; }

/* Fix clearfix: blueprintcss.lighthouseapp.com/projects/15318/tickets/5-extra-margin-padding-bottom-of-page */

.clearfix { zoom: 1; }

Wie Sie sehen können, Sie sind SEHR ähnlich. Aber Sie sind anders.

Hat jemand einen Einblick in diese?

Welche ist besser und warum?

InformationsquelleAutor Johnny | 2011-06-29

Schreibe einen Kommentar