We can use the repeat() function if we have repeating specifications for columns and rows. With the minmax() function, we can define a size range for our grid items. Let’s see how to apply these properties, and how it affects the behaviour of our grid layout.

Using repeat:

            grid-template-columns:
repeat(
3, /*each row has 3 repeat items*/
minmax(10px, auto)
minmax(20px, auto)
minmax(40px, auto)
minmax(80px, auto)
);

Can aslo add named grid line to it:

so that we can refer to those later.

        .container {
display: grid;
grid-gap: 10px;
height: 100vh;
grid-template-columns:
[start] repeat(
3, /*each row has 3 repeat items*/
[col-xs-start] minmax(10px, auto)
[col-xs-end col-sm-start] minmax(20px, auto)
[col-sm-end col-md-start] minmax(40px, auto)
[col-md-end col-lg-start] minmax(80px, auto)
[col-lg-end]
) [end];
} .box:nth-of-type(26){
grid-column: col-sm-start / end;
}

[Grid Layout] Use the repeat function to efficiently write grid-template values的更多相关文章

  1. [Grid Layout] Use the minmax function to specify dynamically-sized tracks

    Using minmax() is an amazingly useful way to specify boundaries for the smallest and largest size a ...

  2. css grid layout in practice

    css grid layout in practice https://caniuse.com/#search=grid subgrid https://caniuse.com/#search=cal ...

  3. css之Grid Layout详解

    css之Grid Layout详解 CSS Grid Layout擅长将页面划分为主要区域,或者在从HTML基元构建的控件的各个部分之间定义大小,位置和图层之间的关系. 与表格一样,网格布局使作者能够 ...

  4. CSS3 Grid Layout & <track-size> & <line-name>

    CSS3 Grid Layout & <track-size> & <line-name> grid container grid-template: < ...

  5. CSS Grid 布局(Grid Layout)完全指南 #flight.Archives003

    Title/ CSS Grid 布局(Grid Layout)完全指南 #flight.Archives003 序 : 写完这篇文章后,我准备一直做下去了,包括flight的各个分区,也看到前方的路. ...

  6. CSS3 GRID LAYOUT

    CSS3 GRID LAYOUT http://www.w3cplus.com/blog/tags/356.html 中国首个开源 HTML5 跨屏前端框架 http://amazeui.org/

  7. iphone Dev 开发实例9:Create Grid Layout Using UICollectionView in iOS 6

    In this tutorial, we will build a simple app to display a collection of recipe photos in grid layout ...

  8. Unity3D 使用 UI 的 Grid Layout Group 组件。

    1.首先创建一个容器,用于存放列表项的内容. 这里使用 Panel 来做为容器. 这里要注意! “Grid Layout Group”是要增加在容器的游戏对象里. 同时,只有容器对象的子对象才有排列效 ...

  9. WPF笔记(2.4 Grid)——Layout

    原文:WPF笔记(2.4 Grid)--Layout 第一章已经简单介绍过这个容器,这一节详细介绍.Grid一般是用表格(Grid.Row 和Grid.Column )的,比StackPanel更细致 ...

随机推荐

  1. POJ 1082 Calendar Game

    Adam and Eve enter this year's ACM International Collegiate Programming Contest. Last night, they pl ...

  2. POJ 1012:Joseph

    Joseph Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 50068   Accepted: 19020 Descript ...

  3. 整理wmic使用,不重启变环境变量 .

    整理wmic使用,不重启变环境变量 . 利用wmic修改是直接生效的:(e:\tools 是新添加的目录) wmic ENVIRONMENT where "name='path' and u ...

  4. 修改chrome的安装目录(默认的竟然安装在documents and settings目录,google真不厚道)

    修改chrome的安装目录(默认的竟然安装在documents and settings目录,google真不厚道) 把chrome从系统目录提取出来 Vista下,Win+R运行 C:/Users/ ...

  5. caffe 在 windows 下的配置(scripts\build_win.cmd)

    官网配置文档见:GitHub - BVLC/caffe at windows 1. windows 设置 requirements: visual studio 2013/2015 CMake > ...

  6. Python *的下载、安装和使用

    最近正在学习机器学习和深度学习,需要python,大家都知道,它是这些领域的入门语言,不多说,直接上干货!突然发现python比java好玩多了 下面就开始python的安装以及测试,python2. ...

  7. C#中数组与ArrayList的简单使用

    1. 多维数组 2. 锯齿数组 3. 数组的常用操作 4. ArrayList 1. 多维数组 多维数组:行数和列数在定义时已确定 string[,] arr = new string[2, 3]; ...

  8. ASP.NET路径解惑

    对于ASP.NET的路径问题,一直都是云里雾里,没有去详细的理解,今天正好可以梳理一下它们之间的关系和使用方法.而若想明白路径的表示方式的使用方法和区别以及注意事项可以通过下面的几个概念来进一步加深: ...

  9. ASP.NET MVC案例教程(基于ASP.NET MVC beta)——第五篇:MVC整合Ajax

    摘要      本文将从完成“输入数据验证”这个功能出发,逐渐展开ASP.NET MVC与Ajax结合的方法.首先,本文将使用ASP.NET MVC提供的同步方式完成数据验证.而后,将分别结合ASP. ...

  10. Jmeter--性能测试工具的搭建

    第一步:Jmeter软件下载第二步:解压下载的Jmeter包到某一盘符下,最好解压到无中文字符目录下,防止乱码问题,以我电脑为例,比如:D:tools第三步:找到解压的文件jmeter.bat,一般在 ...