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

bootstrap clear float

藏色散人
Release: 2023-01-13 00:22:12
Original
3403 people have browsed it

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 "

.. .
”.

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>
Copy after login

.clearfix class is as follows:

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

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template