Pitani kuzinthu zazikulu Pitani kumayendedwe adocs
in English

Clearfix

Chotsani mwachangu komanso mosavuta zomwe zidayandama mkati mwa chidebe powonjezera zida za clearfix.

Zomveka bwino floats powonjezera .clearfix ku chinthu cha makolo . Itha kugwiritsidwanso ntchito ngati mixin.

Gwiritsani ntchito mu HTML:

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

Mixin source code:

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

Gwiritsani ntchito mixin mu SCSS:

.element {
  @include clearfix;
}

Chitsanzo chotsatirachi chikuwonetsa momwe clearfix ingagwiritsire ntchito. Popanda clearfix kukulunga kwa div sikungayende mozungulira mabatani omwe angayambitse kusweka.

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