in English

Tozalash

Clearfix yordam dasturini qo'shish orqali konteyner ichidagi suzuvchi tarkibni tez va oson tozalang.

Asosiy elementgafloat qo'shish orqali s ni osongina tozalang . Aralashma sifatida ham foydalanish mumkin..clearfix

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

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

Quyidagi misol aniq tuzatishdan qanday foydalanish mumkinligini ko'rsatadi. Aniq tuzatishsiz o'rash div tugmalari atrofida aylanmaydi, bu esa tartibning buzilishiga olib keladi.

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