[Grid Layout] Place grid items on a grid using grid-column and grid-row
It’s possible to position a grid item anywhere on a grid track. To do this, let’s specify some grid-template-columns
and grid-template-rows
, and to the grid items, we’ll pass grid-column
and grid-row
some numeric values.
<!DOCTYPE html> <html lang="en"> <head><meta charset="UTF-8"><title>css-place-grid-items-on-a-grid-using-grid-column-and-grid-row</title><style>.grid-item {background-color: cadetblue;}.container {display: grid;grid-gap: 15px;height: 100vh;grid-template-columns: 100px 200px auto auto;}.grid-item:nth-of-type(2) {grid-row: span 2;/* the same asgrid-row-start: 2;*/}.grid-item:nth-of-type(6) {grid-column: 3 / span 2;/* the same asgrid-column-start: 3;grid-column-end 5*/}</style> </head> <body> <div class="container"><div class="grid-item">1</div><div class="grid-item">2</div><div class="grid-item">3</div><div class="grid-item">4</div><div class="grid-item">5</div><div class="grid-item">6</div> </div> </body> </html>
转载于:https://www.cnblogs.com/Answer1215/p/6624977.html
[Grid Layout] Place grid items on a grid using grid-column and grid-row相关推荐
- 愿只有一个Grid Layout
CSS3新增布局三剑客之Grid Layout 一.前言 相比较Multi-Columns Layout 和Flexible Box Layout,Grid Layuot更像是两者的结合,当然这里 ...
- grid layout网格布局详解
grid layout网格布局详解 什么是grid layout grid的特点 grid css属性的基础知识 创建一个grid布局 创建一个网格 隐性网格与显性网格 尺寸单位fr repeat函数 ...
- 【CSS 网格布局 (Grid Layout )】
CSS 网格布局 Grid Layout CSS 网格布局 Grid Layout 1. CSS 网格布局的基本概念 1.1 网格 相关术语 1.2 网格布局的 属性分类 2. grid 属性: 同时 ...
- [Grid Layout] Specify a grid gutter size with grid-gap
It's beautifully straightforward to add a gutter to our grid layout. Let's apply one with grid-gap. ...
- SAP Spartacus b2b 页面 banner 的grid layout设计
如下图所示: 每个banner里的a标签,都应用了grid layout模型: this element behaves like a block element and lays out its c ...
- css高度自动填满_Unity--自动版面(Grid Layout Group)
Grid Layout Group 网格布局组组件将其子布局元素放置在网格中. Padding:(填充) 布局组边缘内的填充.与其他布局组不同,"网格布局组"将忽略其所包含布局元素 ...
- Unity3d Ugui 20 Grid Layout Group Aspect Ratio Fitter
Grid Layout Group网格布局 属性 Padding:布局组内边缘偏移. Cell Size:要用于组内每个布局元素的大小. Spacing:布局子元素之间的间距. Start Corne ...
- html设定列的最小宽度,设置Grid Layout列最小宽度的方法
设置Grid Layout列最小宽度的方法 发布时间:2020-08-29 11:22:09 来源:亿速云 阅读:184 作者:小新 这篇文章主要介绍设置Grid Layout列最小宽度的方法,文中介 ...
- Vue Grid Layout -️ 适用Vue.js的栅格布局系统(保姆级使用教程)
目录 一. Vue Grid Layout 简介 二.vue-grid-layout 的安装与使用 三. 属性 3.1 gridItem 的必须属性 3.2 框架元素的实际宽度高度计算方式 3.3 元 ...
- css grid设置宽度,如何设置Grid Layout (网格布局)列的最小宽度
如何设置Grid Layout (网格布局)列的最小宽度?设置网格的列最小宽度时,在网格的列宽设置部分中使用minmax()函数,下面我们就来看具体的内容. 我们先来看一下minmax()函数的格式m ...
最新文章
- const与define相比优点_const与#define的区别、优点
- python提取excel中的某几列数据-python-将excel中的某些列读取到数据框
- 详解 CSS 属性 - 伪类和伪元素的区别
- IDEA快捷键拆解系列(五):Navigate篇
- Hibernate Annotation _List/Map
- PHP创建图像的应用!!!!
- 集合遍历[设计模式总结] 9. 迭代器模式
- 微软翻译api的使用介绍和注意事项
- android 自动化测试之monkeyrunner学习(三),自动化测试之Monkeyrunner
- iPhone 12的4G/5G信号又翻车了:不少用户吐槽无网络服务
- ITIL是什么意思?ITIL是什么?
- 0x800700b7 linux,电脑安装系统时报错0x800700b7,无法继续安装解决办法
- 计算机辅助绘图包括,计算机辅助绘图实用教程
- centos更新yum时遇到的问题
- 很多网友问那个磁力搜索站好用,就由本君说说吧!
- 用opencv在图片上面添加水印
- Mac 隔空投送 AirDrop 搜不到 iPhone
- 关于阿里矢量图标的普通无色和彩色的使用方法
- java poi word换行符_poi读取word的换行符问题
- Ansys Meshing
热门文章
- 【CodeForces - 334B】Eight Point Sets(水题模拟,有坑)
- 【HDU - 2553】N皇后问题 (dfs经典问题,回溯,搜索)
- java redis 流水线,Redis系列(1) —— 流水线
- apache2+支持php7,Ubuntu14.04下配置PHP7.0+Apache2+Mysql5.7
- 燕山大学数字通信计算机仿真课程设计,燕山大学数字通信计算机仿真课程设计模板...
- HTML简单注册页面
- java设计模式之模板模式
- 数据结构算法 | 单调栈
- 用awk一些常用技巧sort uniq
- mpiBlast安装详解以及使用说明