Source

Hoʻomaʻemaʻe

Hoʻomaʻemaʻe wikiwiki a maʻalahi hoʻi i nā mea lana i loko o kahi pahu ma ka hoʻohui ʻana i kahi pono clearfix.

E hoʻomaʻemaʻe maʻalahi floatma ka hoʻohui .clearfix ʻana i ka mea makua . Hiki ke hoʻohana ʻia ma ke ʻano he mixin.

<div class="clearfix">...</div>
// Mixin itself
@mixin clearfix() {
  &::after {
    display: block;
    content: "";
    clear: both;
  }
}

// Usage as a mixin
.element {
  @include clearfix;
}

Hōʻike ka laʻana ma lalo nei pehea e hoʻohana ʻia ai ka clearfix. Me ka ʻole o ka clearfix, ʻaʻole e holo ka div wrapping a puni nā pihi i mea e haki ai ka hoʻolālā.

<div class="bg-info clearfix">
  <button type="button" class="btn btn-secondary float-left">Example Button floated left</button>
  <button type="button" class="btn btn-secondary float-right">Example Button floated right</button>
</div>