search
HomeWeb Front-endHTML Tutorial【5】Understand Bootstrap's preset grid system_html/css_WEB-ITnose

Before we start, let’s talk about a class, because it will be used later

<div class="container">  ...</div>

You can wrap the content on the page with .container. Center aligned. The width of the container is set within different media query thresholds to match the grid system.

Note: Due to the padding and fixed width settings, .container cannot be nested.

Some people here may not know what "different media query threshold ranges" are? What I want to say here is that a set of ranges is defined (this range has several intervals). If the browser width value (i.e., the visual area) you are currently using is within a certain interval of this set of ranges, then use this The solution for browsing web pages in intervals. (I don’t know if I can make people understand by saying this, sweat ̄□ ̄||)

============================ ================================================== =====================

【1】Let’s introduce the grid system (excerpt from the official website)

Bootstrap has a built-in responsive, mobile-first fluid grid system. As the screen device or viewport size increases, the system will automatically be divided into up to 12 columns.

1. It contains easy-to-use predefined classes (this is what we are talking about, I don’t know if it is an official Chinese typo, why is there an extra e after class);

2 , and there are powerful mixins used to generate more semantic layouts (this is not what we are talking about, it is equivalent to customizing the grid layout you want, the default preset classe is enough for us, if you want to go further , you can study it yourself).

============================================== ================================================== ===

【2】The grid system is used to create a page layout through a series of combinations of rows and columns, and your content can be placed into the created layout.

The following is an introduction to the working principle of the following Bootstrap grid system:

1. "Row" must be included in the .container in order to give it the appropriate alignment and Padding.
2. Use "row" to create a group of "columns" in the horizontal direction.
3. Your content should be placed within "column", and only "column" can be used as a direct child element of row.
4. Through some predefined Grid classes (.row and .col-xs-4) can be used to quickly create grid layouts. The mixins defined in the Bootstrap source code can also be used to create semantic layouts.
5. Create "by setting padding." "Gutter" between "columns". Then offset the effect of padding by setting negative margins for the first and last.
6. The columns in the grid system are specified by specifying 1 to 12 value to represent the range it spans. For example, three equal-width columns can be created using three .col-xs-4

full-screen layout methods:

for those that need to occupy the entire. For browser viewport pages, the content area needs to be wrapped in a container element and given padding: 0 15px; in order to offset the margin: 0 -15px; set for .row (if not If so, your page will be 15px beyond the viewport, and a horizontal scroll bar will appear at the bottom of the page)

ps. To be honest, I didn’t understand a few sentences in the pile above, but I generally understand them. Those who don’t understand can only understand it through the following exercises. Of course, the use of this grid reminds me of using Excel tables. ================================================== ==============================

I have excerpted so many official websites, and we will discuss them again at the beginning. When we talked about "different media query threshold ranges", that is, the grid option, let's take a look at it!

【3】The grid option is how Bootstrap's grid system works on multiple screens. It works on the equipment. Let’s take a look at the table given by the Chinese official website

From the table we can see that there are 4 intervals corresponding to our own equipment. We assume that The view area is x.

The grid class works on devices with a screen width greater than or equal to the threshold, and will override the class set for small screen devices. Therefore, it is applied to any element. Any .col-md- (begins with) class will work not only on medium-sized screens, but also on large-screen devices (if no .col-lg- (begins with) class is set)
lg large(大) x≥1200px 桌面
md middle(中) 992px≤x<1200px 桌面
sm small(小) 768px≤x<992px 平板
xs extra small(极小,网上找的,不知道有没有更合适的) x<768px 手机

Statement
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
操作系统实现按名存取的关键在于解决什么操作系统实现按名存取的关键在于解决什么Aug 17, 2022 am 11:17 AM

操作系统实现按名存取的关键在于解决文件名称与具体的物理地址的转换;实现逻辑文件到物理文件间的转换,即按名存取外存上的文件,按名存取实现文件的共享和保密,不同用户能在系统的控制下共享其他用户的文件。

los是什么系统los是什么系统Nov 07, 2022 pm 04:31 PM

los就是LineageOS,是一个基于Android面向智能手机以及平板电脑的开放源代码操作系统。los的前身为Cyanogenmod,通常称CM,是全球最大的安卓第三方编译团队,促进了用户的安卓版本的第三方升级,在早期曾经先于谷歌为很多手机定制了稳定版的安卓1.6,此后该团队的联合创始人及核心团队,重组了全新的LineageOS,继续为用户提供免费的第三方系统支持。

SAP系统的五大模块是什么SAP系统的五大模块是什么Sep 29, 2022 am 11:52 AM

SAP五大模块是:1、物料管理模块,主要有采购、库房与库存管理、供应商评价等管理功能;2、工厂维护模块,提供对定期维护、检查与服务管理的规划、控制和处理;3、质量管理模块,可提供质量计划、质量检测、质量控制、质量文档等功能;4、销售与分销模块,包括销售计划、询价报价、订单管理、运输发货、发票等的管理;5、生产计划模块,可实现对工厂数据、生产计划、能力计划、成本核算等的管理。

荣耀手机是什么系统荣耀手机是什么系统Jul 27, 2022 am 10:23 AM

荣耀手机使用的是“Magic UI”、“EMUI”和“HarmonyOS”操作系统;荣耀的新机型采用的都是“Magic UI”系统,旧机型普遍使用的是基于安卓的EMUI系统,而部分机型支持升级为华为研发的HarmonyOS操作系统。

如何查看电脑系统是什么版本如何查看电脑系统是什么版本Jan 02, 2021 pm 03:54 PM

方法:1、在电脑桌面上,右击“计算机”,选择“属性”;2、在“系统”界面的“windows 版本”区域即可查看当前系统版本。2、使用“Win+R”快捷键,打开“运行”窗口,输入“winver”回车,在弹出的对话框中即可查看当前系统版本信息。

funtouch os是什么系统funtouch os是什么系统Aug 22, 2022 am 11:43 AM

“funtouch os”是vivo基于安卓系统开发的智能手机操作系统;“funtouch os”是针对vivo公司中高端手机推出的一款人性化手机操作系统,该系统与2013年10月发布,以用户体验为核心,以简约、乐趣、智慧、理念为设计导向。

三星手机是什么系统三星手机是什么系统Nov 16, 2022 pm 05:22 PM

三星手机是安卓系统,只不过不是原生的安卓系统,而是原生安卓系统经过定制之后的系统,例如OneUI。OneUI是在2018年三星开发者大会上推出的全新基于安卓系统深度定制的用户界面,是三星和google合作进行研发的;可以同时运行在折叠屏产品上和非折叠屏产品上,通过交互的改进让两种不同形态的产品都有相近的操作体验。

ghost的本质是什么ghost的本质是什么Aug 29, 2022 pm 03:27 PM

Ghost的本质是对磁盘或者硬盘进行快速备份与还原;利用Ghost安装Windows系统最大的优点就是速度快而且一键安装,并且Ghost系统大多集成了大多数电脑所需要的驱动程序以及一些常用的应用软件。需要注意:1、通过网络下载到的Ghost系统,其预置的驱动程序与自己的电脑可能不兼容,会导致安装之后出现蓝屏而无法正常使用;2、Ghost系统捆绑安装的应用软件太多。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

DVWA

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

Atom editor mac version download

Atom editor mac version download

The most popular open source editor