Source

Sharefix

Da sauri da sauƙi share abun ciki mai iyo a cikin akwati ta ƙara kayan aikin sharefix.

Sauƙaƙe floats ta ƙara .clearfix zuwa kashi na iyaye . Hakanan za'a iya amfani dashi azaman mixin.

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

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

Misali na gaba yana nuna yadda za'a iya amfani da clearfix. Idan ba tare da share fage ba, nannade div ba zai zagaya kusa da maɓallan ba wanda zai haifar da fagewar shimfidar wuri.

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