Tlula eka nhlokomhaka-nkulu Tlula eka docs navigation
Check
in English

Clearfix

Hi ku hatlisa no olova basisa swilo leswi papamalaka endzeni ka xigwitsirisi hi ku engetela xitirhisiwa xa clearfix.

Hlawula s hi ku olova floathi ku engetela .clearfix eka xiaki xa mutswari . Swinga tlhela switirhisiwa tani hi mixin.

Tirhisa eka HTML:

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

Khodi ya xihlovo xa mixin:

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

Tirhisa mixin eka SCSS:

.element {
  @include clearfix;
}

Xikombiso lexi landzelaka xi kombisa ndlela leyi clearfix yi nga tirhisiwaka ha yona. Handle ka clearfix wrapping div a yi ta span ku rhendzela ti buttons leswi a swi ta vanga layout leyi tshovekeke.

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