..."."/> ...".">

Home >Web Front-end >Bootstrap Tutorial >bootstrap clear float

bootstrap clear float

藏色散人
藏色散人Original
2020-12-07 09:07:083397browse

Bootstrap method to clear floats: first open the corresponding code file; then clear the floats by adding the ".clearfix" class to the parent element, with statements such as "f763eb893dac385cb7a7b1e7550aa39e.. .16b28748ea4df4d9c2150843fecfba68”.

bootstrap clear float

The operating environment of this tutorial: Windows 7 system, bootsrap version 3.3.7, Dell G3 computer.

Floats can be easily cleared by adding the .clearfix class to the parent element. What is used here is the micro clearfix method created by Nicolas Gallagher. This class can also be used as a mixin.

The usage method is as follows:

<!-- Usage as a class -->
<div class="clearfix">...</div>

.clearfix class is as follows:

// Mixin itself
.clearfix() {
  &:before,
  &:after {
    content: " ";
    display: table;
  }
  &:after {
    clear: both;
  }
}
// Usage as a mixin
.element {
  .clearfix();
}

Recommended: "bootstrap video tutorial" "css video tutorial

The above is the detailed content of bootstrap clear float. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn