in English

Clearfix a ɛyɛ pefee

Ntɛm na ɛnyɛ den sɛ wobɛpopa nneɛma a ɛsensɛn nsu mu wɔ ade bi mu denam clearfix utility a wode bɛka ho no so.

Ɛnyɛ den sɛ wobɛtew floats so denam .clearfix ɔwofo element no a wode bɛka ho no so . Wobetumi nso de adi dwuma sɛ mixin.

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

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

Nhwɛsoɔ a ɛdidi soɔ yi kyerɛ sɛdeɛ wɔbɛtumi de clearfix no adi dwuma. Sɛ ɛnyɛ clearfix no a, wrapping div no rentumi ntwa buttons no ho hyia a ɛbɛma layout no abubu.

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