Home >
Web Front-end >
HTML Tutorial >
The Beauty of Bootstrap 302-Grid Introduction and Application_html/css_WEB-ITnose
The Beauty of Bootstrap 302-Grid Introduction and Application_html/css_WEB-ITnose
WBOY
Release: 2016-06-24 11:59:21
Original
1024 people have browsed it
This article mainly includes:
■ Introduction to Grid ■ Application Grid ■ Multiple Grids
Introduction to Grid
In Bootstrap, the page is divided into 12 equal parts. This is the so-called Grid.
In Bootstrap, controlled by class names, these types follow a form similar to ".col-xx-6".
Two sixes take up the entire page. Therefore, the number at the end of the class name indicates how many spaces it will occupy.
Another example, three 4s also occupy the entire page.
Another example, four 3s also occupy the entire page.
Another example, 6 2’s also occupy the entire page.
In addition, for class names like ".col-xx-10 .col-xx-offset-2", offset means offset, and 2 means offset to the right. 2 cells.
It is worth noting that in the second to last line, when putting ".col--xx-3" in ".col-xx-3 .col-xx-offset After -2", ".col--xx-3" will automatically run to the beginning of the next line because it exceeds the size of 12 cells.
Applying Grid
How to apply Grid to the section whose id is body? →In index.html, add the class="container" attribute to the section with the id of body →Add the class="col-md-8" attribute to the section with the id of main → Add the class="col-md-4" attribute to the section with the ID of sidebar
How to apply Grid to the header and footer parts? →Remove the class="container" attribute of the div with id page, and it becomes:
→Add the class="container" attribute to the header, and it becomes: < ;header class="container"> →Add the class="container" attribute to the footer and it becomes:
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