Tlolela ho litaba tsa mantlha Tlolela ho li-docs navigation
in English

Hlakisa

Hlakola ka potlako le ha bonolo litaba tse phaphametseng ka har'a sets'oants'o ka ho eketsa sesebelisoa sa clearfix.

Hlakola ha bonolo floats ka ho eketsa .clearfix karolo ea motsoali . E ka boela ea sebelisoa e le mixin.

Sebelisa ka HTML:

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

Khoutu ea mohloli oa mixin:

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

Sebelisa motsoako ho SCSS:

.element {
  @include clearfix;
}

Mohlala o latelang o bontša kamoo clearfix e ka sebelisoang kateng. Ntle le clearfix, div e phuthelang e ne e ke ke ea potoloha likonopo tse ka bakang sebopeho se robehileng.

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