Ale nan kontni prensipal la Ale nan navigasyon dokiman yo
in English

Clearfix

Byen vit ak fasil klè kontni flote nan yon veso lè w ajoute yon sèvis piblik clearfix.

Fasil klè floats lè w ajoute .clearfix nan eleman paran an . Kapab tou itilize kòm yon mixin.

Itilize nan HTML:

<div class="clearfix">...</div>

Kòd sous mixin la:

@mixin clearfix() {
  &::after {
    display: block;
    clear: both;
    content: "";
  }
}

Sèvi ak mixin nan SCSS:

.element {
  @include clearfix;
}

Egzanp sa a montre kouman clearfix la ka itilize. San clearfix la vlope div la pa ta span alantou bouton yo ki ta lakòz yon layout kase.

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