Clearfix
Type:
Mixin
@include
clearfix();
* You can call mixins with or without
gls-
namespace (e.g. @include gls-clearfix();
).Clearfix Sass mixin helps you to clear floats to prevent broken layouts and must be applied to the parent element.
Examples
Simply clear floats by calling the mixin in the parent element’s selector.
.element{
@include clearfix;
}
//CSS Output
.element::after {
content: "";
display: block;
clear: both;
}