当前位置:网站首页>Introduction to Grid Layout
Introduction to Grid Layout
2022-08-02 06:12:00 【m0_67401228】
1. What is Grid layout
Grid
layout is grid layout, which is a new css
model. Generally, a page is divided into several main areas, and the size of these areas is defined., position and hierarchy, is currently the only css
two-dimensional layout.
The difference between 2, and flex
layout
The Grid
layout is substantially different from the flex
layout. flex
is a one-dimensional layout and can only handle one dimension.Layout, row or column.However, the Grid
layout is a two-dimensional layout, dividing the container into "rows" and "columns", resulting in grids one by one, and grid elements can be placed in positions related to rows and columns, so as to achieve the purpose of layout.
flex
Layout example:
Grid
Layout example:
3, Grid
concept of layout
First, let's look at a small example to demonstrate some basic concepts
OneTwoThreeFourFiveSix.wrapper{margin: 60px;/* declare a container */display: grid;/* Declare the width of the column, the number 3 is repeated 3 times, that is, there are 3 columns with a width of 200px*/grid-template-columns: repeat(3,200px);/* declare line and column spacing */grid-gap: 20px;/* Represent the height of the two lines respectively */grid-template-rows: 100px 200px;}.item{text-align: center;font-size: 200%;color: #fff;}.one{background-color:#b8e8e0 ;}.two{background-color: #8CC7B5;}.three{background-color:#efe3bf ;}.four{background-color: #BEE7E9;}.five{background-color: #E6CEAC;}.six{background-color: #ECAD9E;}Run result:
![[External link image transfer failed, the origin site may have an anti-leech mechanism, it is recommended to save the imageDirect upload(img-6Kmdz0qf-1650274526452)(image-20220418172435782.png)]](/img/00/a730a2eb0bc6761da9bcb25c5bba7d.png)
Containers and Items
We create a grid by declaring display:grid
or display:inline-grid
on the elementContainer, all immediate children of this element will become grid items.
Grid Track
grid-template-columns
and grid-template-rows
properties to define the rows and columns in the grid
- Grid cells
A grid unit is the smallest unit in a grid element, One
, Two
, Three
, Four
…are all grid cells one by one
Gridlines
The lines that divide the grid are gridlines.It should be noted that when we define the grid, we define the grid track.Grid automatically creates numbered gridlines to position each element, m columns with m + 1 vertical gridlines, and n rows with n + 1 horizontal gridlines.Generally speaking, from left to right, from top to bottom, 1, 2, 3 are numbered and sorted, and from right to left, from bottom to top, they are numbered in the order of -1, -2, -3...
![[External link image transfer failed, the origin site may have anti-leech mechanism, it is recommended to save the imageDirect upload(img-iDntqg9z-1650274526453)(image-20220418173153836.png)]](/img/23/dbbec0bf71e5d1e8ad5c524963bdf0.png)
Let me introduce myself first. The editor graduated from Jiaotong University in 2013. I worked in a small company and went to big factories such as Huawei and OPPO. I joined Ali in 2018, until now.I know that most junior and intermediate java engineers want to upgrade their skills, they often need to explore their own growth or sign up to study, but for training institutions, the tuition fee is nearly 10,000 yuan, which is really stressful.Self-learning that is not systematic is very inefficient and lengthy, and it is easy to hit the ceiling and the technology stops.Therefore, I collected a "full set of learning materials for java development" for everyone. The original intention is also very simple. I hope to help friends who want to learn by themselves but don't know where to start, and at the same time reduce everyone's burden.Add the business card below to get a full set of learning materials
边栏推荐
- 系统(层次)聚类
- MySQL导入sql文件的三种方法
- swinIR论文阅读笔记
- 【Gazebo入门教程】第一讲 Gazebo的安装、UI界面、SDF文件介绍
- navicat连接MySQL报错:1045 - Access denied for user ‘root‘@‘localhost‘ (using password YES)
- ES6——class类实现继承
- 牛客-TOP101-BM41
- 认识CAN光纤转换器的光纤接口和配套光纤线缆
- Matlab论文插图绘制模板第41期—气泡图(bubblechart)
- MySQL String Concatenation - Various String Concatenation Practical Cases
猜你喜欢
Redis-集群模式(主从复制模式,哨兵模式,集群化模式)
【HCIE】NO.30 OSPFv3的基本配置
【热题】LeetCode 热题 HOT 100分类+题解
navicat connects to MySQL and reports an error: 1045 - Access denied for user 'root'@'localhost' (using password YES)
MySQL 字符串拼接 - 多种字符串拼接实战案例
ApiPost is really fragrant and powerful, it's time to throw away Postman and Swagger
Detailed explanation of mysql stored procedure
Google Chrome(谷歌浏览器)安装使用
navicat新建数据库
认识消防报警联网中CAN光纤转换器的光纤接口和配套光纤线缆
随机推荐
ORA-04044:此处不允许过程、函数、程序包或类型,系统分析与解决
golang环境详细安装、配置
The original question on the two sides of the automatic test of the byte beating (arranged according to the recording) is real and effective 26
go项目的打包部署
[PSQL] 窗口函数、GROUPING运算符
Android studio连接MySQL并完成简单的登录注册功能
【QT】Qt Creator生成动态库(DLL)并调用
apisix-入门使用篇
MySQL安装教程
物联网通信协议全解析
H5如何实现唤起APP
Google 安装印象笔记剪藏插件
认识CAN光纤转换器的光纤接口和配套光纤线缆
Redis常见题型
Mysql 回表
Google Chrome(谷歌浏览器)安装使用
MySql copies data from one table to another table
从DES走到AES(现代密码的传奇之路)
合作的小伙伴,缺乏主人翁(owner)意识,好苦恼
12个MySQL慢查询的原因分析