当前位置:网站首页>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.
flexLayout example:
![[External link image transfer failed, the origin site may have anti-leech mechanism, it is recommended to save the imageDirect upload(img-EvPhz2Tm-1650274526450)(image-20220418170327412.png)]](/img/07/64c09dd1feb7a80c4eeec972785521.png)
GridLayout example:
![[External link image transfer failed, the origin site may have an anti-leech mechanism, it is recommended to save the imageDirect upload(img-MkDsHpXv-1650274526451)(image-20220418172044225.png)]](/img/01/084c21af6f1365347722758f788a2f.png)
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
边栏推荐
- 物联网通信协议全解析
- Towhee 每周模型
- "Digital reconstruction of the system, getting the CEO is the first step"
- apisix-Getting Started
- Navicat报错:1045-Access denied for user [email protected](using passwordYES)
- mysql 查询表 所有字段
- What do interview test engineers usually ask?The test supervisor tells you
- [PSQL] 窗口函数、GROUPING运算符
- 安全测试常见问题
- 2022河南萌新联赛第(四)场:郑州轻工业大学 C - 最大公因数
猜你喜欢

interrupt()、interrupted()和isInterrupted()你真的懂了吗

mysql 8.0.28版本安装配置方法图文教程

navicat connects to MySQL and reports an error: 1045 - Access denied for user 'root'@'localhost' (using password YES)

力扣 2127. 参加会议的最多员工数 拓扑剪枝与2360补充

Mycat2.0搭建教程

MySQL implements sorting according to custom (specified order)

2022年100道最新软件测试面试题,常见面试题及答案汇总

ORA-04044:此处不允许过程、函数、程序包或类型,系统分析与解决

分享|5G+智慧工业园区解决方案(附PDF)

ERROR 1045 (28000) Access denied for user 'root'@'localhost'Solution
随机推荐
Detailed explanation of AMQP protocol
一线大厂软件测试流程(思维导图)详解
interrupt()、interrupted()和isInterrupted()你真的懂了吗
PDF file conversion format
golang泛型
数学建模学习笔记:层次分析法(AHP)
MySQL 8.0.29 解压版安装教程(亲测有效)
H5如何实现唤起APP
MySQL 游标
MySQL 字符串拼接 - 多种字符串拼接实战案例
go项目的打包部署
Navicat报错:1045 -拒绝访问用户[email protected](使用passwordYES)
leetcode 665. Non-decreasing Array 非递减数列(中等)
Android Studio 实现登录注册-源代码 (连接MySql数据库)
prisma使用mongodb副本集群报错引发的一些列问题
【HCIE】NO.45 Hub and Spoke配置案例
Google Chrome(谷歌浏览器)安装使用
Matlab学习第二天
【Gazebo入门教程】第一讲 Gazebo的安装、UI界面、SDF文件介绍
安全测试常见问题