Bootstrap grid layout system example
1. Basic principles:
1. Think of the screen as a grid/grid/cell/composition arranged in an orderly manner along the horizontal and vertical directions;
2. All data must be placed in the grid;
3. Use responsive layout, mobile settings take priority
2. Screen resolution division basis
1. ( screen < 768px ): ultra-small screen col-xs-x
2. (768px <= screen < 992px): small screen col-sm-x
3. (992px < = screen < 1200) : medium screen col-md-x
4. (1200 <= screen ) : large screen col-lg-x
2. Implementation principle
1. The first step: a container must be created, class="container"
2. The second step: a row must be created, class="row"
3. The third step : A grid must be created, class="col-md-x", taking a medium screen as an example, the critical point is 992px
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <link rel="stylesheet" href="dist/css/bootstrap.css"> <script src="jquery-3.2.1.js"></script> <script src="dist/js/bootstrap.js"></script> <title>栅格布局系统</title> <style> .grid { border: 1px solid #696969; border-radius: 5px; background-color: lightskyblue; min-height: 30px; text-align: center; line-height: 30px; } .green { background-color: lightgreen; } .pink { background-color: lightpink; } </style> </head> <body> <div class="container"> <h4>整行:</h4> <div class="row"> <div class="col-md-12 grid">内容</div> </div> <h4>二等分:</h4> <div class="row"> <!--<div class="col-md-6 grid">内容</div>--> <!--大屏39分--> <!--<div class="col-md-6 col-lg-3 grid green">内容</div>--> <!--小屏48分--> <div class="col-md-6 col-lg-3 col-sm-4 grid green">内容</div> <!--<div class="col-md-6 col-sm-8 grid">内容</div>--> <!--<div class=" col-md-6 grid">内容</div>--> <!--<div class=" col-md-6 col-lg-9 grid pink">内容</div>--> <div class=" col-md-6 col-lg-9 grid col-sm-8 pink">内容</div> <!--<div class=" col-md-6 col-sm-4 grid">内容</div>--> </div> <h4>三等分:</h4> <div class="row"> <div class="col-md-4 grid">内容</div> <div class="col-md-4 grid">内容</div> <div class="col-md-4 grid">内容</div> </div> <h4>四等分:</h4> <div class="row"> <div class="col-md-3 grid">内容</div> <div class="col-md-3 grid">内容</div> <div class="col-md-3 grid">内容</div> <div class="col-md-3 grid">内容</div> </div> <!--<h4>五等分:12除5除不尽,不用五等分</h4>--> <h4>六等分:</h4> <div class="row"> <div class="col-md-2 grid">内容</div> <div class="col-md-2 grid">内容</div> <div class="col-md-2 grid">内容</div> <div class="col-md-2 grid">内容</div> <div class="col-md-2 grid">内容</div> <div class="col-md-2 grid">内容</div> </div> <h4>四八开:</h4> <div class="row"> <div class="col-md-4 grid">内容</div> <div class="col-md-8 grid">内容</div> </div> <h4>三九开:</h4> <div class="row"> <div class="col-md-3 grid">内容</div> <div class="col-md-9 grid">内容</div> </div> </div> </body> </html>
[Related video recommendations: Bootstrap tutorial】
The above is the detailed content of Bootstrap grid layout system example. For more information, please follow other related articles on the PHP Chinese website!

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

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

It's out! Congrats to the Vue team for getting it done, I know it was a massive effort and a long time coming. All new docs, as well.

With the recent climb of Bitcoin’s price over 20k $USD, and to it recently breaking 30k, I thought it’s worth taking a deep dive back into creating Ethereum

I had someone write in with this very legit question. Lea just blogged about how you can get valid CSS properties themselves from the browser. That's like this.

The other day, I spotted this particularly lovely bit from Corey Ginnivan’s website where a collection of cards stack on top of one another as you scroll.

I'd say "website" fits better than "mobile app" but I like this framing from Max Lynch:

There are a number of these desktop apps where the goal is showing your site at different dimensions all at the same time. So you can, for example, be writing

If we need to show documentation to the user directly in the WordPress editor, what is the best way to do it?

Questions about purple slash areas in Flex layouts When using Flex layouts, you may encounter some confusing phenomena, such as in the developer tools (d...
