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. Vue 消息无缝滚动

    vue实现消息向上无缝滚动效果 <ul class="new-list" :class="{anim:animate}" @mouseenter=&quo ...

  2. Mybaits中session的应用一

    获取一级缓存session SqlSession session = this.yangchebaoDbManagerImpl.getSqlSessionFactory().openSession(f ...

  3. [Javascript AST] 4. Continue: Report ESLint error

    const disallowedMethods = ["log", "info", "warn", "error", & ...

  4. 3. Spring Boot Servlet

    转自:https://blog.csdn.net/catoop/article/details/50501686

  5. Spark应用程序部署工具Spark Submit

    不多说,直接上干货!  spark-submit在哪个位置 [spark@master ~]$ cd $SPARK_HOME/bin [spark@master bin]$ pwd /usr/loca ...

  6. 为什么在AJAX里面直接return 一个值,接受不到?

    1.AJAX是异步执行流程,后面的代码可能会先一步执行.把异步改为同步. 2.JS函数作用域问题,现在外面声明一个全局变量,等success后再把值给变量,这样就可以return 值了.

  7. 无法显式调用运算符或访问器 错误处理方法 DLL study

    无法显式调用运算符或访问器 错误处理方法 转 无法显式调用运算符或访问器 错误处理方法 反汇编一个dll类库,导出的项目会报出很多bug,其中主要的就是“无法显式调用运算符或访问器”这个错误,看了一下 ...

  8. 【Codeforces Round #446 (Div. 2) A】Greed

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 贪心选容量大的瓶子就好 [代码] #include <bits/stdc++.h> #define int long l ...

  9. H5移动端IOS/Android兼容性总结,持续更新中…

    H5移动端IOS/Android兼容性总结,持续更新中… 1. IOS不识别日期 new Date("2018-07-01 08:00:00")在Android下正常显示可以直接进 ...

  10. StackExchange.Redis 官方文档

    原文:StackExchange.Redis 官方文档 时隔多年的翻译终于完成了第六个,也是很重要的的官方文档,是介绍有关链接管理,管道流水线和多路复用的 官方地址在这里:官方文档 下面做个汇总: S ...