Container
-
Center: A container with the class name .container. The width of the center has different values on each screen device. The width of the center is different on both sides of the center. Just leave it blank.
The width of the center of each size is as follows:Screen equipment The width of the center of the page max-width:768px xs inherits the width of the parent element (i.e. width: 100%) min-width:768px sm 750px min-width:992px #md 970px min-width:1200px lg 1170px
.container { padding-right: 15px; padding-left: 15px; margin-right: auto; margin-left: auto; }@media (min-width: 768px) { .container { width: 750px; }} @media (min-width: 992px) { .container { width: 970px; }} @media (min-width: 1200px) { .container { width: 1170px; }} .container-fluid { padding-right: 15px; padding-left: 15px; margin-right: auto; margin-left: auto; }
No matter what the width of the screen is, the container.container will always have a padding of 15px on the left and right to prevent the content from sticking directly to the edge of the browser. Never nest another container in a container.
.container-fluid's layout container is the same as the layout container smaller than 768px screen. It does not set a fixed width value and inherits it. The width of the parent element.
.container container is used to provide width constraints on responsive width. In response to changes in size, the container is actually changed. Rows and columns are based on percentages, so they do not need to make any changes.
Row (row)
Row: A container with class name .row; it is column (col) There is a total of space and it is divided into 12 columns.
There will be two negative 15px margin values at both ends of the row, in order to offset the padding values on both sides of the container. .row is invalid when used outside the container.
.row { margin-right: -15px; margin-left: -15px; }
Column
Each column has 15px padding on both sides value. Never use col outside a .row container, otherwise col will be invalid.
The padding value of each column col provides a blank space for its content so that the content will not stick to the edge of the browser and the columns will not stick together.
==Columns are allocated according to percentages (relative to the percentage of the center width, so the wider the center, the greater the width of each column)==.
//五列的宽度 .col-xs-5 { width: 41.66666667%; }// 四列的宽度 .col-xs-4 { width: 33.33333333%; }// 三列的宽度 .col-xs-3 { width: 25%; }// 占两列的宽度 .col-xs-2 { width: 16.66666667%; }// 每列的宽度是版心宽度的8.33333333% .col-xs-1 { width: 8.33333333%; }... // 如果是中等屏幕 类名为.col-md-1 // 小屏幕 类名为:.col-sm-1 // 大屏幕 类名为:.col-lg-1 @media (min-width:768px) { .col-sm-1 { width: 8.33333333%; } .col-sm-2 { width: 16.66666667%; } ... } @media (min-width: 992px) { .col-md-1 { width: 8.33333333%; } .col-md-2 { width: 16.66666667%; } ... } @media (min-width:1200px) { .col-lg-1 { width: 8.33333333%; } .col-lg-2 { width: 16.66666667%; } ... }
栅格嵌套
After setting container/row/column, you can create a new grid in the column In the grid system, just add rows directly to the column. There is no need to add a container, because the padding values on both sides of the column can offset the negative margin values on both sides of the row, and the column is equivalent to a container.
Offsets
Offset offset is mainly the margin of the column -left value determines. If it is offset by one column, it is margin-left:8.3333333% (1/12). If it is offset by two columns, it is margin-left:16.66666667% (that is, 2/12);
.col-xs-offset-0 { margin-left: 0; }.col-xs-offset-1 { margin-left: 8.33333333%; }... @median (min-width:768px) { .col-sm-offset-0 { margin-left: 0; } .col-sm-offset-1 { margin-left: 8.33333333%; } ... } ...
Column sorting (Push and Pull)
In practical applications, it is more about calling position and sorting, allowing you to break the html p Fixed layout from top to bottom and left to right.
pull and push are implemented through the right and left values of position. Pull is implemented through the right value. The pull-1 value right:8.33333333% (1/12); push-1 value => left:8.33333333%(1/12);
// push 距离左边的距离(向右推的列数)以最小屏为例 .col-xs-push-2 { left: 16.66666667%; }.col-xs-push-1 { left: 8.33333333%; }.col-xs-push-0 { left: auto; }... // pull 距离右边的距离(向左拉的列数)以最小屏为例 .col-xs-pull-2 { right: 16.66666667%; }.col-xs-pull-1 { right: 8.33333333%; }.col-xs-pull-0 { right: auto; }
The above is the detailed content of Bootstrap raster analysis. For more information, please follow other related articles on the PHP Chinese website!

If you've ever had to display an interactive animation during a live talk or a class, then you may know that it's not always easy to interact with your slides

With Astro, we can generate most of our site during our build, but have a small bit of server-side code that can handle search functionality using something like Fuse.js. In this demo, we’ll use Fuse to search through a set of personal “bookmarks” th

I wanted to implement a notification message in one of my projects, similar to what you’d see in Google Docs while a document is saving. In other words, a

Some months ago I was on Hacker News (as one does) and I ran across a (now deleted) article about not using if statements. If you’re new to this idea (like I

Since the early days of science fiction, we have fantasized about machines that talk to us. Today it is commonplace. Even so, the technology for making

I remember when Gutenberg was released into core, because I was at WordCamp US that day. A number of months have gone by now, so I imagine more and more of us

The idea behind most of web applications is to fetch data from the database and present it to the user in the best possible way. When we deal with data there

Let's do a little step-by-step of a situation where you can't quite do what seems to make sense, but you can still get it done with CSS trickery. In this


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 English version
Recommended: Win version, supports code prompts!

Atom editor mac version download
The most popular open source editor