We can use named grid lines to describe our grid layout. Let’s see how to apply this to our grid-template-columns and grid-template-rows, and how to refer to these from our grid items.

Syntax like:

            grid-template-columns:
[left-sidebar-start] 1fr
[main-content-start] 2fr
[right-sidebar-start] 1fr;

We can name those whatever we want to.

You can also give multi names for one line:

            grid-template-columns:
[left-sidebar-start] 1fr
[left-sidebar-end main-content-start] 2fr
[main-content-end right-sidebar-start] 1fr
[right-sidebar-end];

And we also named the last columns name as 'right-sidebar-end'.

Later we can contorl the position like this:

            grid-template-rows:
[body-start] 6fr
[body-end footer-start] 2fr
[footer-end];

The same for the rows:

            grid-template-rows:
[body-start] 6fr
[body-end footer-start] 2fr
[footer-end];

So for four column lines: 

 --> left-sidebar-start

 --> left-sidebar-end, main-content-start

 --> main-content-end, right-sidebar-start

 --> right-sidebar-end

For three row lines:

 --> body-start

 --> body-end, footer-start

 --> footer-end

For more information, check the article

[Grid Layout] Describe a grid layout using named grid lines的更多相关文章

  1. Auto Layout Guide----(一)-----Understanding Auto Layout

    Understanding Auto Layout 理解自动布局 Auto Layout dynamically calculates the size and position of all the ...

  2. 问题-[Delphi]在对GRID设置单击为编辑时,其他GRID可以,但有一个GRID不行?

    问题现象:在对GRID设置单击为编辑时,其他GRID可以,但有一个GRID不行?问题原因:在这个GRID中的单击事件可能不存在,可以测试一下有没有单击事件.解决方法:需要在GRID的上一个类中,放开单 ...

  3. [Grid Layout] Describe a grid layout using grid-template-areas

    We can describe the nature of a grid in an ‘ASCII-art’ way with grid-template-areas. Let’s see how t ...

  4. 理解css中Grid布局,在项目中如何实现grid页面布局

    简介 CSS中Grid是一种二维网格式布局方式.我们常规使用table.float.position.inline-block等布局,但它们遗漏了很多功能,例如垂直居中.后来css3中flexbox的 ...

  5. Layout Inflation :Unconditional layout, inflation from view adapter

    Layout inflation在Android上下文环境下转换XML文件成View结构对象的时候需要用到. LayoutInflater这个对象在Android的SDK中很常见,但是你绝对没想到竟然 ...

  6. ext:grid分页,列宽度自动填满grid宽度

    var cm = new Ext.grid.ColumnModel([{      header : '编号',      dataIndex : 'id'     }, {      header ...

  7. Ext grid单元格编辑时获取获取Ext.grid.column.Column

    item2.width = 80; //item2.flex = 1; item2.align = 'center'; item2.menuDisabled = true; //禁止显示列头部右侧菜单 ...

  8. Grid属性太多记不住?【Grid栅格布局可视化编辑器】直观易懂高效,拖拉拽,有手就行!

    手把手教你通过拖拉拽可视化的方式带你练习[Grid栅格布局]的各个属性,直观易懂!再也不愁记不住繁多的Grid属性了.整个过程在众触应用平台进行,不用手写一行CSS代码. grid-auto-flow ...

  9. CSS: Grid Layout Module

    Grid Layout The CSS Grid Layout Module offers a grid-based layout system, with rows and columns, mak ...

随机推荐

  1. Win8.1恢复这台电脑里的6个文件夹

    平台:win8.1 问题:网络下载的ghost版8.1,装好后“这台电脑”里没有6个常用的文件夹. 解决:导入下列注册表项即可 Windows Registry Editor Version 5.00 ...

  2. Emmet学习教程

    Emmet (前身为 Zen Coding) 是一个能大幅度提高前端开发效率的一个工具,Emmet是很成熟的并且非常适用于编写HTML/XML 和 CSS 代码的前端开发人员,但也可以用于编程语言.所 ...

  3. 【2017 Multi-University Training Contest - Team 9】Numbers

    [链接]http://acm.hdu.edu.cn/showproblem.php?pid=6168 [题意] 有一个长度为n的序列a1--an,根据a序列生成了一个b序列,b[i] = a[i]+a ...

  4. cocos2d-x认识之旅

    cocos2d-x 学习历程 1. 了解cocos2d-x.官网 : www.cocos2d-x.org 2. 搭建cocos2d-x. 使用版本号cocos2d-x 3.0 搭建好开发环境教程:ht ...

  5. 10.static_extern

    另一个文件声明 #include <iostream> using namespace std; ; void show() { cout << " << ...

  6. 1.namesapce用法

    namespace用法示例 #include <iostream> using namespace std; //定义域名空间 namespace myspace { ; void sho ...

  7. ES5, ES6, ES2016, ES.Next: JavaScript 的版本是怎么回事?

    原网址:http://huangxuan.me/2015/09/22/js-version/ JavaScript 有着很奇怪的命名史. 1995 年,它作为网景浏览器(Netscape Naviga ...

  8. 【习题 6-9 UVA - 127】"Accordian" Patience

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 链表模拟即可. 1pile不能加s... [代码] #include <bits/stdc++.h> using nam ...

  9. LeetCode Algorithm 05_Longest Palindromic Substring

    Given a string S, find the longest palindromic substring in S. You may assume that the maximum lengt ...

  10. ORACLE RMAN备份--差异增量与累积增量的策略实例图

    转自原文 ORACLE RMAN备份--差异增量与累积增量的策略实例图