css clearfix mixin

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了css clearfix mixin相关的知识,希望对你有一定的参考价值。

// The clearfix mixin
.clearfix() {
  &:after {
    content: ".";
    display: block;
    height: 0;
    clear: both;
    visibility: hidden;
  }
}
 
// Apply clearfix on .parent
.parent {
  .clearfix();
}
.clearfix:after {
     visibility: hidden;
     display: block;
     font-size: 0;
     content: " ";
     clear: both;
     height: 0;
     }
.clearfix { display: inline-block; }
/* start commented backslash hack \*/
* html .clearfix { height: 1%; }
.clearfix { display: block; }
/* close commented backslash hack */

以上是关于css clearfix mixin的主要内容,如果未能解决你的问题,请参考以下文章

scss Clearfix mixin

scss SCSS Clearfix Mixin

scss mixin:clearfix-extend

scss mixin:clearfix

scss Sass mixin用于快速应用clearfix

css #css:CSS Clearfix