Source

Sula ukulungisa

Sula ngokushesha futhi kalula okuqukethwe okuntantayo ngaphakathi kwesiqukathi ngokwengeza insiza yokulungisa okucacile.

Sula kalula floats ngokungeza .clearfix isici esingumzali . Ingasetshenziswa futhi njenge-mixin.

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

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

Isibonelo esilandelayo sibonisa ukuthi i-clearfix ingasetshenziswa kanjani. Ngaphandle kokulungiswa okucacile i-div yokugoqa ngeke idlule izinkinobho ezingadala isakhiwo esiphukile.

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