in English
Ukulungisa
Ucoca ngokukhawuleza nangokulula umxholo odadayo ngaphakathi kwesikhongozeli ngokongeza into eluncedo ecacileyo.
Cacisa ngokulula float
s ngokongeza .clearfix
kwinto engumzali . Inokusetyenziswa kwakhona njengomxube.
<div class="clearfix">...</div>
// Mixin itself
@mixin clearfix() {
&::after {
display: block;
content: "";
clear: both;
}
}
// Usage as a mixin
.element {
@include clearfix;
}
Lo mzekelo ulandelayo ubonisa indlela i-clearfix enokusetyenziswa ngayo. Ngaphandle kokucoca i-div yokusonga ayinakujikeleza amaqhosha anokubangela ubeko olwaphukileyo.
<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>