in English

Clearfix

Cepet lan gampang mbusak konten sing ngambang ing wadhah kanthi nambah utilitas clearfix.

Gampang mbusak floats kanthi nambahake .clearfix unsur induk . Bisa uga digunakake minangka campuran.

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

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

Conto ing ngisor iki nuduhake carane clearfix bisa digunakake. Tanpa clearfix, div bungkus ora bakal ngubengi tombol sing bakal nyebabake tata letak sing rusak.

<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>