Chapter 5: BootStrap Grid System_javascript skills
Bootstrap, from Twitter, is currently the most popular front-end framework. Bootstrap is based on HTML, CSS, and JAVASCRIPT. It is simple and flexible, making web development faster.
Learning points:
1. Mobile devices first
2. Layout container
3. Grid system
In this lesson we will mainly learn about Bootstrap’s grid system, which provides a responsive, mobile-first fluid grid system.
1. Mobile first
In the HTML5 project, we made a mobile project. It has a very important meta, which is used to set the same width as the screen and device, whether to run user scaling, and the scaling ratio.
1 2 |
|
2. Layout container
Bootstrap requires a .container container to wrap the page content and grid system. Due to attributes such as padding, these two container classes cannot be nested in each other.
1 2 3 4 5 6 7 8 |
|
In the grid system, the browser will automatically allocate up to 12 columns as the screen size increases or decreases. Create a page layout through a series of rows and columns. Here’s how it works:
1. "Row" must be contained in .container (fixed width) or .container-fluid (100% width) in order to give it appropriate alignment and padding.
2. Create a group of "columns" in the horizontal direction through "rows".
3. Your content should be placed within "column", and only "column" can be a direct child element of row.
4. Predefined classes like .row and .col-xs-4 can be used to quickly create grid layouts.
Mixins defined in the Bootstrap source code can also be used to create semantic layouts.
5. Create a gutter between columns by setting the padding attribute for "column". By setting a negative value for the .row element
margin thus offsets the padding set for the .container element, and indirectly offsets the padding for the "column" contained in the "row".
6. The negative value of margin is why the example below protrudes outward. Contents in grid columns line up.
7. Columns in the grid system represent the range they span by specifying values from 1 to 12. For example, three equal-width columns can be created using three .col-xs-4 s.
8. If a "row" contains more than 12 "columns", the elements of the extra "columns" will be arranged as a whole in another row.
9. The grid class is suitable for devices with a screen width greater than or equal to the dividing point size, and the grid class is overridden for small screen devices. Therefore, applying any .col-md-* raster classes on an element works for devices with screen widths greater than or equal to the breakpoint size, and overrides the raster class for small-screen devices. Therefore, applying any .col-lg-* on the element does not exist and also affects large screen devices.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
|
Raster parameter table
As shown in the picture above, the outermost layer of the grid system distinguishes four browser widths: ultra-small screen (<768px), small screen (>=768px), medium screen (>=992px) and Large screen (>=1200px). The adaptive widths of the inner .container container are: automatic, 750px, 970px and 1170px. Automatic means that if you are on a mobile phone screen, it will occupy one line of display.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
|
The above is the relevant information for the BootStrap grid system. I hope it will be helpful to everyone!

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

AI Hentai Generator
Generate AI Hentai for free.

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



Frequently Asked Questions and Solutions for Front-end Thermal Paper Ticket Printing In Front-end Development, Ticket Printing is a common requirement. However, many developers are implementing...

There is no absolute salary for Python and JavaScript developers, depending on skills and industry needs. 1. Python may be paid more in data science and machine learning. 2. JavaScript has great demand in front-end and full-stack development, and its salary is also considerable. 3. Influencing factors include experience, geographical location, company size and specific skills.

How to merge array elements with the same ID into one object in JavaScript? When processing data, we often encounter the need to have the same ID...

JavaScript is the cornerstone of modern web development, and its main functions include event-driven programming, dynamic content generation and asynchronous programming. 1) Event-driven programming allows web pages to change dynamically according to user operations. 2) Dynamic content generation allows page content to be adjusted according to conditions. 3) Asynchronous programming ensures that the user interface is not blocked. JavaScript is widely used in web interaction, single-page application and server-side development, greatly improving the flexibility of user experience and cross-platform development.

In-depth discussion of the root causes of the difference in console.log output. This article will analyze the differences in the output results of console.log function in a piece of code and explain the reasons behind it. �...

Once you have mastered the entry-level TypeScript tutorial, you should be able to write your own code in an IDE that supports TypeScript and compile it into JavaScript. This tutorial will dive into various data types in TypeScript. JavaScript has seven data types: Null, Undefined, Boolean, Number, String, Symbol (introduced by ES6) and Object. TypeScript defines more types on this basis, and this tutorial will cover all of them in detail. Null data type Like JavaScript, null in TypeScript

Discussion on the realization of parallax scrolling and element animation effects in this article will explore how to achieve similar to Shiseido official website (https://www.shiseido.co.jp/sb/wonderland/)...

JavaScript can be run in PowerPoint, and can be implemented by calling external JavaScript files or embedding HTML files through VBA. 1. To use VBA to call JavaScript files, you need to enable macros and have VBA programming knowledge. 2. Embed HTML files containing JavaScript, which are simple and easy to use but are subject to security restrictions. Advantages include extended functions and flexibility, while disadvantages involve security, compatibility and complexity. In practice, attention should be paid to security, compatibility, performance and user experience.
