css grid layout in practice

https://caniuse.com/#search=grid

subgrid

https://caniuse.com/#search=calc

tutorials

https://css-tricks.com/snippets/css/complete-guide-grid/

grid & animation

https://codepen.io/xgqfrms/pen/jOEEOWg


See the Pen CSS Grid Layout: Animation by xgqfrms
(@xgqfrms) on CodePen.

grid & function

https://css-tricks.com/snippets/css/complete-guide-grid/#article-header-id-4

https://codepen.io/xgqfrms/pen/JjoojYN


See the Pen CodePen Home That Grid Thing Everybody Loves 'Cause It's Awesome by xgqfrms
(@xgqfrms) on CodePen.

grid layout

https://codepen.io/webgeeker/pen/GRgRVBZ


<!-- CSS Grid -->
<h1 class="title">CSS GRID</h1>
<div class="wrapper">
<div class="header">HEADER</div>
<div class="menu">MENU</div>
<div class="content">CONTENT</div>
<div class="footer">FOOTER</div>
</div>


.wrapper {
display: grid;
grid-template-columns: repeat(12, 1fr);
/* 水平 12 col 布局 */
grid-template-rows: 40px 100px 40px;
/* 垂直,3 row 高度 */
/* overflow: auto; */
} .wrapper > div {
padding-left: 20px;
color: #ffeead;
display: flex;
align-items: center;
font-size: 20px;
/* min-width: 200px; */
} .header {
grid-column: span 12;
} .menu {
grid-column: span 4;
} .content {
grid-column: span 8;
} .footer {
grid-column: span 12;
} @media screen and (max-width: 480px) {
.header {
grid-column: span 6;
} .menu {
/* 指定所在的 row 为 1 */
grid-row: 1;
grid-column: span 6;
} .content {
grid-column: span 12;
}
}

See the Pen css grid layout demo by xgqfrms
(@webgeeker) on CodePen.

grid container

...

grid item

css grid & fallback

https://www.smashingmagazine.com/2017/11/css-grid-supporting-browsers-without-grid/

https://codepen.io/webgeeker/pen/LYEPqwe


* { box-sizing: border-box; } body {
margin: 40px;
background-color: #fff;
color: #444;
font: 1.4em Arial, sans-serif;
} .grid {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-auto-rows: 100px;
grid-gap: 20px;
} .grid > * {
padding: 10px;
border: 5px solid rgba(214,129,137,.5);
border-radius: 5px;
background-color: rgba(233,78,119,.5);
color: #fff;
float: left;
width: 33%;
} @supports (display:grid) {
.grid > * {
width: auto;
}
}

https://zellwk.com/blog/calendar-flexbox-fallback/

@supports

特征检测, flexbox 渐进增强(grid 优雅降级)

https://developer.mozilla.org/en-US/docs/Web/CSS/@supports

https://caniuse.com/#search=@supports



/*  flexbox 渐进增强 */

.day-of-week,
.date-grid {
display: flex;
} /* grid 优雅降级 */ @supports (display: grid) {
.day-of-week,
.date-grid {
display: grid;
grid-template-columns: repeat(7, 1fr);
} .date-grid button:first-child {
grid-column: 6;
}
}

CSS3 Grid Layout

http://www.csstutorial.org/css-grid-tutorial.html

https://www.cnblogs.com/xgqfrms/p/10771746.html

https://www.cnblogs.com/xgqfrms/p/10896992.html

refs



xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


css grid layout in practice的更多相关文章

  1. CSS: Grid Layout Module

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

  2. [CSS] Get up and running with CSS Grid Layout

    We’ll discuss the display values pertinent to CSS Grid Layout – grid, inline-grid, and subgrid. Then ...

  3. CSS Grid Layout In Action

    CSS Grid Layout In Action CSS 异形网格布局实战 refs https://static-nginx-online.fbcontent.cn/tutor/tutor-ybc ...

  4. 各个浏览器开启CSS Grid Layout的方式

    2017年3月,Chrome.Firefox将开启默认支持. 当然对于很多人等不及浏览器默认支持,想提前体验一把,这里提供一些打开方式: 1.Chrome 在浏览器中输入:chrome://flags ...

  5. CSS Grid layout布局

    CSS Grid布局 (又名"网格"),是一个基于二维网格布局的系统,主要目的是改变我们基于网格设计的用户接口方式.你只需要定义一个容器元素并设置display:grid,使用gr ...

  6. CSS grid layout

      CSS网格布局用于将页面分割成数个主要区域,或者用来定义组件内部元素间大小.位置和图层之间的关系. 像表格一样,网格布局让我们能够按行或列来对齐元素. 但是,使用CSS网格可能还是比CSS表格更容 ...

  7. CSS grid layout demo 网格布局实例

    直接 上代码,里面我加注释,相当的简单, 也可以去我的github上直接下载代码,顺手给个星:https://github.com/yurizhang/micro-finance-admin-syst ...

  8. 关于CSS Grid Layout的代码解释

    .wrapper { display: grid; /*生成grid类型块级网格*/ grid-template-columns: repeat(3, 1fr); /*设置显示的列网格线,且重复3次1 ...

  9. css之Grid Layout详解

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

随机推荐

  1. 【ElasticSearch】 使用AWS云ES服务来分析程序日志

    最近公司系统升级,有些API的调用接口达到了每天10几万的请求量.目前公司里的日志,都是写文本文件中的.为了能够更好的分析这些日志数据,公司采用了AWS 的 ElasticSearch服务来分析日志. ...

  2. 云原生项目实践DevOps(GitOps)+K8S+BPF+SRE,从0到1使用Golang开发生产级麻将游戏服务器—第1篇

    项目初探 项目地址: 原项目:https://github.com/lonng/nanoserver 调过的:https://github.com/Kirk-Wang/nanoserver 这将是一个 ...

  3. 【PY从0到1】第七节 函数

    # 7 第七节 函数 # 函数对于编程语言来说是一块重量级的内容. # 他可以实现或者简化编写的代码. # 编写好特定功能的函数后,就可以重复调用函数来完成任务. # 下面我们就用函数的形式来封装前面 ...

  4. (二)SpringBoot应用运维脚本

    SpringBoot应用运维脚本 一.获取PID 二.Kill命令 三.nohup命令 四.编写SpringBoot应用运维脚本 4.1全局变量 4.2编写核心方法 4.3Info方法 4.4stat ...

  5. Spring Boot,Spring Cloud,Eureka,Actuator,Spring Boot Admin,Stream,Hystrix

    Spring Boot,Spring Cloud,Eureka,Actuator,Spring Boot Admin,Stream,Hystrix 一.Spring Cloud 之 Eureka. 1 ...

  6. Spring boot获取getBean

    package com.job.center.quartz.common; import org.springframework.beans.BeansException; import org.sp ...

  7. python--可迭代对象、迭代器和生成器

    迭代器 1.什么是迭代器? 不依赖于索引的取值方式 迭代是一个重复的过程,即每一次重复为一次迭代,并且每次迭代的结果都是下一次迭代的初始值 示例: str1 = 'abcde' count = 0 w ...

  8. Java中finalize()方法的作用

    finalize方法是Object提供的的实例方法,使用规则如下: 当对象不再被任何对象引用时,GC会调用该对象的finalize()方法 finalize()是Object的方法,子类可以覆盖这个方 ...

  9. Java线程 - sleep()和wait()方法的区别, 线程阻塞BLOCKED和等待WAITING的区别

    一. sleep()和wait()方法的区别 sleep()方法 sleep()方法是Thread类的方法,通过其定义可知是个native方法,在指定的时间内阻塞线程的执行.而且从其注释中可知,并不会 ...

  10. 【noi 2.6_9268】酒鬼(DP)

    题意:有N瓶酒,不能连续喝>=3瓶的酒,问能喝的最大的酒量. 解法:同前一题相似,可以f[i][j]表示前i瓶中连续喝了j瓶的最大酒量.1.f[i][0]=f[i-1][3] ; 2.i=1或2 ...