Source

ક્લિયરફિક્સ

ક્લિયરફિક્સ યુટિલિટી ઉમેરીને કન્ટેનરમાં તરતી સામગ્રીને ઝડપથી અને સરળતાથી સાફ કરો.

પેરેંટ એલિમેન્ટમાંfloat ઉમેરીને s સરળતાથી સાફ કરો . મિક્સિન તરીકે પણ વાપરી શકાય છે..clearfix

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

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

નીચેના ઉદાહરણ બતાવે છે કે કેવી રીતે ક્લિયરફિક્સનો ઉપયોગ કરી શકાય છે. ક્લિયરફિક્સ વિના રેપિંગ ડીવી બટનોની આસપાસ ફેલાયેલ નથી જે તૂટેલા લેઆઉટનું કારણ બનશે.

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