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. iTOP-4412开发板p2p视频

    整体框架: 一.发送端 1.摄像头通过V4L2接口得到YUV视频格式,可以在win7上用yuvplayer播放 2.使用4412硬件编码模块MFC提供的接口进行硬件编码,得到.264文件,可以在win ...

  2. VMware Tools安装问题的解决

    一.VMware Tools工具的作用 VMware虚拟机的插件工具,安装上它可以实现主机与虚拟机的文件共享及拖放.简单的说就是从Ubuntu上边经常输入命令行会出现错误的情况,需要复制到Window ...

  3. Kurento应用开发指南(以Kurento 5.0为模板) 之中的一个:简单介绍,安装与卸载

    文件夹 1. Kurento是什么               3 2. Kurento简单介绍                       3 2.1 WebRTC媒体server         ...

  4. LinearLayout-layout_gravity 属性没有效果分析

    今天在一个布局文件中,遇到了一个问题,先看代码 <LinearLayout android:layout_width="match_parent" android:layou ...

  5. 12. ZooKeeper之Java客户端API使用—创建会话。

    转自:https://blog.csdn.net/en_joker/article/details/78686649 客户端可以通过创建一个ZooKeeper(org.apache.zookeeper ...

  6. Solr 读数据流程

    Solr 读数据流程: 1.用户提供搜索关键词,也就是搜索语句,需要经过分词器处理以及语言处理. 2.对处理之后的关键词,搜索索引找出对应Document 即记录. 3.用户根据需要从找到的Docum ...

  7. 含有打印、统计DataGridView(1)

    using System;using System.Collections.Generic;using System.Text;using System.Drawing.Printing;using ...

  8. 使用Spring Security3的四种方法概述

    使用Spring Security3的四种方法概述 那么在Spring Security3的使用中,有4种方法: 一种是全部利用配置文件,将用户.权限.资源(url)硬编码在xml文件中,已经实现过, ...

  9. 00103_死锁、Lock接口、等待唤醒机制

    1.死锁 (1)同步锁使用的弊端:当线程任务中出现了多个同步(多个锁)时,如果同步中嵌套了其他的同步.这时容易引发一种现象:程序出现无限等待,这种现象我们称为死锁.这种情况能避免就避免掉: synch ...

  10. 【习题 6-3 UVA - 536】 Tree Recovery

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 递归题 [代码] #include <bits/stdc++.h> using namespace std; const ...