SlideShare ist ein Scribd-Unternehmen logo
1 von 120
Downloaden Sie, um offline zu lesen
CSS Grid Layout
Rachel Andrew
Generate, September 2015
Rachel Andrew
http://rachelandrew.co.uk
@rachelandrew
http://grabaperch.com
The trouble with CSS layout
• Floats and clearfix hacks
• Absolute positioning means elements are taken
out of document flow and risk overlaps
• Redundant markup and positioning oddities with
display: table
• White space issues with inline-block
The cost of taming layout methods
• Developer hours spent learning non-obvious
concepts.
• Compromises in terms of document semantics in
order to achieve responsive layouts.
• Needing to lean on frameworks to help with
complex math.
• Adding markup to create grids
• Using preprocessors to abstract layout hacks
https://www.flickr.com/photos/zervas/2810241612
Flexbox?
Seeing Flexbox as the silver bullet for
layout issues is likely to lead us down
another path of layout hacks.
We need a designed for purpose
layout system for the sites and
applications we develop today.
CSS Grid Layout
Our HTML consists of a
div with a class of
wrapper and six child
elements.
<div class="wrapper">
<div class="a">A</div>
<div class="b">B</div>
<div class="c">C</div>
<div class="d">D</div>
<div class="e">E</div>
<div class="f">F</div>
</div>
To create a grid we use a
new value of the display
property.
display: grid
.wrapper {
display: grid;
}
We describe the grid using
the new properties:
grid-template-columns
grid-template-rows
.wrapper {
display: grid;
grid-template-columns:
100px 10px 100px 10px 100px;
grid-template-rows:
auto 10px auto;
}
We position items using the
new properties:
grid-column-start

grid-column-end

grid-row-start

grid-row-end
.a {
grid-column-start: 1;
grid-column-end: 2;
grid-row-start: 1;
grid-row-end: 2;
}
To position an item bottom
centre, I start at column
line 3, this is the line after
the gutter track.
.b {
grid-column-start: 3;
grid-column-end: 4;
grid-row-start: 3;
grid-row-end: 4;
}
To span more tracks we
just change the end row or
column line.
.b {
grid-column-start: 3;
grid-column-end: 6;
grid-row-start: 3;
grid-row-end: 4;
}
The longhand for line-
based placement means
up to 4 properties to
position each element. .a {
grid-column-start: 1;
grid-column-end: 2;
grid-row-start: 1;
grid-row-end: 2;
}
.b {
grid-column-start: 3;
grid-column-end: 4;
grid-row-start: 3;
grid-row-end: 4;
}
Declare start and end
values with grid-column
and grid-row.
Values are separated by a
/ symbol.
.a {
grid-column: 1 / 2;
grid-row: 1 / 2;
}
.b {
grid-column: 3 / 6;
grid-row: 3 / 4;
}
Declare all 4 values using
the grid-area property.
.a {
grid-area: 1 / 1 / 2 / 2;
}
.b {
grid-area: 3 / 3 / 4 / 6;
}
Grid lines relate to writing mode. In
a right to left language such as
Arabic the first column line is the
right-hand line.
Grid Terminology
Grid Lines
Lines can be horizontal or vertical. They
are referred to by number and can be
named.
Highlighted is Column Line 2.
Grid Track
A Grid Track is the space between two
Grid Lines. Tracks can be horizontal or
vertical (rows or columns).
The highlighted Grid Track is between
Row Lines 2 and 3.
Grid Cell
The smallest unit on our grid, a Grid Cell
is the space between four Grid Lines. It’s
just like a table cell.
The highlighted Grid Cell is between row
lines 2 and 3 and column lines 2 and 3.
Grid Area
Any area of the Grid bound by 4 Grid
Lines. It can contain many Grid Cells.
The highlighted Grid Area is between
row lines 1 and 3, column lines 2 and 4.
All examples can be found at http://gridbyexample.com. Use Chrome. Enable “Experimental Web Platform Features” flag.
Line-based placement
http://gridbyexample.com/examples/code/layout9.html
The HTML around my
page content.
The various areas of my
page are child elements
of a div with a class of
wrapper.
<div class="wrapper">
<header class="mainheader"></header>
<div class="panel"></div>
<div class="content"></div>
</div>
CSS Grid Layout
Declaring a grid on
wrapper.
The grid has three
columns, and four rows.
.wrapper {
width: 100%;
max-width: 960px;
margin: 0 auto;
display: grid;
grid-template-columns: 30% 5% 65%;
grid-template-rows: 40px auto 20px auto;
}
CSS Grid Layout
Positioning our elements
using the grid-column and
grid-row shorthand.
This is all we need to do
to create our layout.
.mainheader {
grid-column: 1 / 4;
grid-row: 2 / 3;
}
.panel {
grid-column: 1 / 2;
grid-row: 4 / 5;
}
.content {
grid-column: 3 / 4;
grid-row: 4 / 5;
}
CSS Grid Layout
CSS Grid Layout
I can add a footer to this
layout.
<div class="wrapper">
<header class="mainheader"></header>
<div class="panel"></div>
<div class="content"></div>
<footer class="mainfooter"></footer>
</div>
Positioning the footer
between row lines five
and six.
.mainfooter {
grid-column: 1 / 4;
grid-row: 5 / 6;
}
CSS Grid Layout
Our grid only has 5 row
lines specified - yet we
placed an item between
row lines 5 and 6.
Grid creates an implicit
grid line for us.
.wrapper {
display: grid;
grid-template-columns: 30% 5% 65%;
grid-template-rows: 40px auto 20px auto;
}
.mainfooter {
grid-column: 1 / 4;
grid-row: 5 / 6;
}
Grid lines can be explicit or implicit
• Explicit grid lines are those specified using grid-
template-rows or grid-template-columns.
• Implicit lines are created when you place
something into a row or column track outside of
the explicit grid.
• You can specify a size with the grid-auto-
columns and grid-auto-rows properties.
Grid is “table like” however …
• Unlike a table for layout Grid does not rely on
your content being a particular order in the
source.

• Being entirely described in CSS we can move
things around the Grid at different breakpoints,
introduce or redefine a Grid for any breakpoint.
Power and Responsibility
• As with Flexbox you can use your ability to
change how things are ordered for good or evil.
• Good = creating the most accessible source
order and using Grid to get the optimal display
for each device.
• Bad = using Grid as an excuse to forget about
the source.
• Terrible - stripping out semantic elements to
make everything a child of the grid.
Using Grid to order the
page elements in a single
column for narrow screen
widths.
.wrapper {
display: grid;
grid-template-rows:
10px auto 10px auto 10px auto 10px auto;
}
.mainheader {
grid-row: 2 / 3;
}
.content {
grid-row: 4 / 5;
}
.panel {
grid-row: 6 / 7;
}
.mainfooter {
grid-row: 8 / 9;
}
CSS Grid Layout
Redefine the Grid at min-
width 550 pixels.
Position items as in the
earlier example.
@media (min-width: 550px) {
.wrapper {
grid-template-columns: 30% 5% 65%;
grid-template-rows: 40px auto 20px auto 20px auto;
}
.mainheader {
grid-column: 1 / 4;
grid-row: 2 / 3;
}
.panel {
grid-column: 1 / 2;
grid-row: 4 / 5;
}
.content {
grid-column: 3 / 4;
grid-row: 4 / 5;
}
.mainfooter {
grid-column: 1 / 4;
grid-row: 6 / 7;
}
}
Named Grid Lines
http://gridbyexample.com/examples/code/layout10.html
Name lines with the name
in square brackets.
Remember we name grid
lines and not grid tracks.
.wrapper {
display: grid;
grid-template-rows:
10px [row-header-start] auto [row-header-end]
10px [row-content-start] auto [row-content-end]
10px [row-panel-start] auto [row-panel-end]
10px [row-footer-start] auto [row-footer-end];
}
Here we are positioning
based on line numbers.
.mainheader {
grid-row: 2 / 3;
}
.content {
grid-row: 4 / 5;
}
.panel {
grid-row: 6 / 7;
}
.mainfooter {
grid-row: 8 / 9;
}
Here we are positioning
by named lines.
.mainheader {
grid-row: row-header-start / row-header-end ;
}
.content {
grid-row: row-content-start / row-content-end;
}
.panel {
grid-row: row-panel-start / row-panel-end ;
}
.mainfooter {
grid-row: row-footer-start / row-footer-end;
}
Named Areas
http://gridbyexample.com/examples/code/layout11.html
We assign a name to the
elements on our page.
I am doing this outside of
any Media Queries.
.mainheader {
grid-area: header;
}
.content {
grid-area: content;
}
.panel {
grid-area: sidebar;
}
.mainfooter {
grid-area: footer;
}
Describe the layout on
the parent element using
the grid-template-areas
property.
A period “.” indicates that
this grid cell is empty.
.wrapper {
display: grid;
grid-template-rows:
10px auto 10px auto 10px auto 10px auto;
grid-template-areas:
"."
"header"
"."
"content"
"."
"sidebar"
"."
"footer";
}
CSS Grid Layout
CSS Grid Layout
Redefining the template
areas for the wider
layout. @media (min-width: 550px) {
.wrapper {
grid-template-columns: 30% 5% 65%;
grid-template-rows:
2em auto 1em auto 1em auto;
grid-template-areas:
". . ."
"header header header"
". . ."
"sidebar . content"
". . ."
"footer footer footer"
}
}
CSS Grid Layout
CSS Grid Layout
Another syntax change!
The May 15th Editor’s
Draft allows for multiple
full stop characters to be
used to indicate an empty
cell.
This means you can line
up your ascii art more
neatly.
@media (min-width: 550px) {
.wrapper {
grid-template-columns: 30% 5% 65%;
grid-template-rows:
2em auto 1em auto 1em auto;
grid-template-areas:
"....... ...... ......."
"header header header "
"....... ...... ......."
"sidebar ...... content"
"....... ...... ......."
"footer footer footer "
}
}
Implicit Named Grid Lines
Named grid areas create
four implicit named lines.
You can use these in the
same way as lines you
have explicitly named.
.wrapper {
grid-template-columns: 30% 5% 65%;
grid-template-rows: 2em auto 1em auto 1em
auto;
grid-template-areas: ". . ."
"header header header"
". . ."
"sidebar . content"
". . ."
"footer footer footer"
}
.test {
z-index: 100;
background-color: red;
grid-column: content-start / content-end;
grid-row: content-start / footer-end;
}
CSS Grid Layout
Items on the Grid can be layered
using the z-index property.
A 12 column, flexible grid
The Bootstrap grid, and
those in other
frameworks relies on our
describing the layout in
the markup.
<!-- Stack the columns on mobile by making one full-width and
the other half-width -->
<div class="row">
<div class="col-xs-12 col-md-8">.col-xs-12 .col-md-8</div>
<div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
</div>
<!-- Columns start at 50% wide on mobile and bump up to 33.3%
wide on desktop -->
<div class="row">
<div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
<div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
<div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
</div>
<!-- Columns are always 50% wide, on mobile and desktop -->
<div class="row">
<div class="col-xs-6">.col-xs-6</div>
<div class="col-xs-6">.col-xs-6</div>
</div>
With CSS Grid Layout we describe the
layout in the CSS and can redefine
that description at any breakpoint.
getskeleton.com
You can use the repeat
keyword to repeat all or
part of the grid definition.
This would create 4 200
pixel wide tracks,
separated by a 20 pixel
wide gutter track.
grid-template-columns: repeat(4, 200px 20px);
The fr unit is a flexible
length that represents a
fraction of the available
space in the grid
container.
grid-template-columns: 5fr 1fr 10fr 1fr 5fr;
We can give multiple grid
lines the same name.
This means we can use
the span keyword to span
n number of lines, rather
than specifying a specific
grid line.
.wrapper {
grid-template-columns:
repeat(4, [col] 200px [gutter] 20px);
}
.content {
grid-column: col 2 / span gutter 2;
}
The markup used to
create the Grid using the
Skeleton framework.
Like the Bootstrap Grid
and other similar
frameworks it requires
classes that describe the
grid to be added to the
markup.
<div class="container">
<h1>Skeleton Grid</h1>
<div class="example-grid">
<div class="row">
<div class="four columns">Four columns</div>
<div class="four columns">Four columns</div>
<div class="four columns">Four columns</div>
</div>
<div class="row">
<div class="eight columns">Eight columns</div>
<div class="four columns">Four columns</div>
</div>
<div class="row">
<div class="three columns">Three columns</div>
<div class="three columns">Three columns</div>
<div class="three columns">Three columns</div>
<div class="three columns">Three columns</div>
</div>
<div class="row">
<div class="six columns">Six columns</div>
<div class="six columns">Six columns</div>
</div>
</div>
CSS Grid Layout
When using CSS Grid
Layout we have no need
to describe our grid in
markup.
<div class="wrapper skeleton">
<h1 class="header">CSS Grid Layout Version</h1>
<div class="box1">Four columns</div>
<div class="box2">Four columns</div>
<div class="box3">Four columns</div>
<div class="box4">Eight columns</div>
<div class="box5">Four columns</div>
<div class="box6">Three columns</div>
<div class="box7">Three columns</div>
<div class="box8">Three columns</div>
<div class="box9">Three columns</div>
<div class="box10">Six columns</div>
<div class="box11">Six columns</div>
</div>
Defining the 12 column
grid.
The repeat keyword
repeats the pattern of
columns or rows the
number of times specified
before the comma.
.wrapper {
display: grid;
grid-template-columns:
repeat(11, [col] 4fr [gutter] 3.5fr ) [col] 4fr [gutter];
grid-template-rows:
auto repeat(4, [row] auto [gutter] 15px);
}
Placing box1 on the grid.
Multiple lines have the
same name. This means we
can use the span keyword.
Here I place box1 starting
at the first line named col,
spanning to the 4th line
named gutter.
In the first row named row,
spanning to the first line
named gutter.
.box1 {
grid-column: col / span gutter 4;
grid-row: row / span gutter;
}
Placing box8 on the grid.
Starting on column line 7,
spanning 3 gutter lines.
In the 3rd row named row,
spanning 1 gutter line.
.box8 {
grid-column: col 7 / span gutter 3;
grid-row: row 3 / span gutter;
}
CSS Grid Layout
With Grid Layout we can
easily span rows just like
columns.
.box1b {
grid-column: col / span gutter 4;
grid-row: row / span gutter 2;
}
.box2b {
grid-column: col 5 / span gutter 4;
grid-row: row / span gutter 3;
}
http://gridbyexample.com/examples/code/layout12.html
The header and footer
span the full grid.
The content and panel
display side by side.
.mainheader {
grid-column: col / span gutter 12;
grid-row: row /span gutter;
}
.mainfooter {
grid-column: col / span gutter 12;
grid-row: row 3 /span gutter;
}
.content {
grid-column: col 5 / span gutter 8;
grid-row: row 2 / span gutter;
}
.panel {
grid-column: col / span gutter 4;
grid-row: row 2 / span gutter;
}
http://gridbyexample.com/examples/code/layout13.html
The header and footer
span the full grid.
The content and panel
display side by side.
.mainheader {
grid-column: col / span gutter 12;
grid-row: row /span gutter;
}
.mainfooter {
grid-column: col / span gutter 12;
grid-row: row 3 /span gutter;
}
.content {
grid-column: col 5 / span gutter 8;
grid-row: row 2 / span gutter;
}
.panel {
grid-column: col / span gutter 4;
grid-row: row 2 / span gutter;
}
I change three values to
make our panel extend to
the foot of the page.
.mainheader {
grid-column: col / span gutter 12;
grid-row: row /span gutter;
}
.mainfooter {
grid-column: col 5 / span gutter 8;
grid-row: row 3 /span gutter;
}
.content {
grid-column: col 5 / span gutter 8;
grid-row: row 2 / span gutter;
}
.panel {
grid-column: col / span gutter 4;
grid-row: row 2 / span gutter 2;
}
CSS Grid Layout
Grid Item Placement Algorithm
http://dev.w3.org/csswg/css-grid/#grid-item-placement-algorithm
“The following grid item placement
algorithm resolves automatic positions of
grid items into definite positions, ensuring
that every grid item has a well-defined grid
area to lay out into.”
CSS Grid Layout
My markup is an
unordered list with a
class of wrapper.
The first list item
contains text. The rest an
image.
Two list items have a
class of ‘wide’.
<ul class="wrapper">
<li class="text"><p>…</p></li>
<li><img src="../images/balloon1.jpg" alt="hot air balloon" />
<p>Balloons 1</p></li>
<li><img src="../images/balloon2.jpg" alt="hot air balloon" />
<p>Balloons 2</p></li>
<li><img src="../images/balloon3.jpg" alt="hot air balloon" />
<p>Balloons 3</p></li>
<li class="wide"><img src="../images/balloon4.jpg" alt="hot air
balloon" />
<p>Balloons 4</p></li>
<li><img src="../images/balloon5.jpg" alt="hot air balloon" />
<p>Balloons 5</p></li>
<li><img src="../images/balloon6.jpg" alt="hot air balloon" />
<p>Balloons 6</p></li>
<li class="wide"><img src="../images/balloon7.jpg" alt="hot air
balloon" />
<p>Balloons 7</p></li>
<li><img src="../images/balloon8.jpg" alt="hot air balloon" />
<p>Balloons 8</p></li>
</ul>
CSS Grid Layout
Narrow screen layout,
before any media queries.
A single column, single
row grid.
Grid layout will create
implicit rows for any
additional list items.
.wrapper {
display: grid;
grid-template-columns: 1fr;
grid-template-rows: auto;
grid-auto-flow: dense;
}
CSS Grid Layout
At a 460 pixel breakpoint
we redefine the grid to
have two equal columns.
With grid-auto-flow set
to dense gaps are not left
in the grid if they can be
filled.
@media (min-width: 460px) {
.wrapper {
grid-template-columns: 1fr 1fr;
}
.text {
grid-column: 1 / 3;
}
.wide {
grid-column: auto / span 2;
}
}
CSS Grid Layout
We move to 4 equal
columns at 660 pixels.
I position the li with a
class of text between
column lines 2 and 4, and
row lines 1 and 3.
@media (min-width: 660px) {
.wrapper {
grid-template-columns: 1fr 1fr 1fr 1fr;
}
.text {
grid-column: 2 / 4;
grid-row: 1 / 3;
}
}
http://gridbyexample.com/examples/code/layout8.html
The complete CSS for this
grid.
.wrapper {
display: grid;
max-width: 960px;
grid-template-columns: 1fr;
grid-template-rows: auto;
grid-auto-flow: dense;
}
@media (min-width: 460px) {
.wrapper {
grid-template-columns: 1fr 1fr;
}
.text {
grid-column: 1 / 3;
}
.wide {
grid-column: auto / span 2;
}
}
@media (min-width: 660px) {
.wrapper {
grid-template-columns: 1fr 1fr 1fr 1fr;
}
.text {
grid-column: 2 / 4;
grid-row: 1 / 3;
}
}
We change the value of
grid-auto-flow to sparse.
.wrapper {
display: grid;
max-width: 960px;
grid-template-columns: 1fr;
grid-template-rows: auto;
grid-auto-flow: sparse;
}
@media (min-width: 460px) {
.wrapper {
grid-template-columns: 1fr 1fr;
}
.text {
grid-column: 1 / 3;
}
.wide {
grid-column: auto / span 2;
}
}
@media (min-width: 660px) {
.wrapper {
grid-template-columns: 1fr 1fr 1fr 1fr;
}
.text {
grid-column: 2 / 4;
grid-row: 1 / 3;
}
}
CSS Grid Layout
We need to talk about Grid
The Gutter Problem
CSS Grid Layout
Defining the 12 column
grid.
We define Grid Tracks
that will be used as
columns, preceded by a
line named ‘col’ and those
used as gutters, preceded
by a line named ‘gutter’.
.wrapper {
display: grid;
grid-template-columns:
repeat(11, [col] 4fr [gutter] 3.5fr ) [col] 4fr [gutter];
grid-template-rows:
auto repeat(4, [row] auto [gutter] 15px);
}
CSS Grid Layout
Column and Row gaps are now part of
the Level 1 Grid Layout specification.
Specifying gutters as grid
tracks.
.wrapper {
display: grid;
grid-template-columns: repeat(11, [col] 4fr
[gutter] 3.5fr ) [col] 4fr [gutter];
grid-template-rows: auto repeat(4, [row] auto
[gutter] 15px);
}
Specifying gutters with
the new properties:
grid-row-gap
grid-column-gap
.wrapper {
display: grid;
grid-column-gap: 1em;
grid-row-gap: 1em;
grid-template-columns: repeat(12, [col] 4fr );
grid-template-rows: auto;
}
Nested Grids and Subgrids
In this markup the boxes
e, f and g are children of
the element with a class
of d.
<div class="wrapper">
<div class="box a">A</div>
<div class="box b">B</div>
<div class="box c">C</div>
<div class="box d">
<div class="box e">E</div>
<div class="box f">F</div>
<div class="box g">G</div>
</div>
</div>
To make box d a grid itself
I declare a grid as normal
then position the children
of this element.
They take their grid lines
from the grid declared on
box d.
.d{
grid-column: col 3 / span gutter 2;
grid-row: row 2;
display: grid;
grid-template-columns: 1fr 10px 1fr;
grid-template-rows: auto 10px auto;
}
.e {
grid-column: 1 / 4;
grid-row: 1;
}
.f {
grid-column: 1;
grid-row: 3;
}
.g {
grid-column: 3;
grid-row: 3;
}
http://gridbyexample.com/examples/code/example21.html
Declaring a subgrid
In our existing layout we
are creating a completely
new grid on box d.
.d{
grid-column: col 3 / span gutter 2;
grid-row: row 2;
display: grid;
grid-template-columns: 1fr 10px 1fr;
grid-template-rows: auto 10px auto;
}
If we declare that this
grid is a subgrid, we can
then position the children
of this element on the
same grid their parent is
placed on. .d{
grid-column: col 3 / span gutter 2;
grid-row: row 2;
display: grid;
grid-template-columns: subgrid;
grid-template-rows: subgrid;
}
http://dev.w3.org/csswg/css-grid/
“The following features are at-risk, and may
be dropped during the CR period:
the subgrid value of grid-template-columns
and grid-template-rows, and its component
parts individually”
Without subgrid we create the potential for
accessibility problems. Authors may remove
semantic markup in order to use grid layout.
http://fantasai.inkedblade.net/style/discuss/subgrid-markup/
https://rachelandrew.co.uk/archives/2015/07/28/modern-css-layout-power-and-responsibility/
Grid needs your feedback!
Enable Experimental Web Platform Features in Chrome.
Play with my examples and think up ways you would use Grid.
Blog, make examples, point out problems.
Follow the CSS Grid conversation on www-style by searching for
[css-grid].
See the current issues in the Editor’s Draft http://dev.w3.org/
csswg/css-grid/#issues-index
Browser Support
All my examples work in Chrome unprefixed - you need to enable
the Experimental Web Platform Features flag.
You can also use Webkit nightlies, with the -webkit prefix.
The work in Blink and Webkit is being done by Igalia, sponsored by
Bloomberg.
IE10 and up has support for the old syntax, with an -ms prefix.
Grid is on the Edge backlog, marked as High Priority.
Mozilla are currently implementing Grid in Firefox.
There is a Polyfill under active development: https://github.com/
FremyCompany/css-grid-polyfill/
All examples can be found at http://gridbyexample.com. Use Chrome. Enable “Experimental Web Platform Features” flag.
Thank you!
http://rachelandrew.co.uk/presentations/css-grid
@rachelandrew

Weitere ähnliche Inhalte

Was ist angesagt?

presentation on Edge computing
presentation on Edge computingpresentation on Edge computing
presentation on Edge computingsairamgoud16
 
Semi-supervised Machine Learning
Semi-supervised Machine LearningSemi-supervised Machine Learning
Semi-supervised Machine LearningSpotle.ai
 
Quantum computing
Quantum computingQuantum computing
Quantum computingEmrah Semiz
 
Seminar report on quantum computing
Seminar report on quantum computingSeminar report on quantum computing
Seminar report on quantum computingSavita Sharma
 
100+ Artificial Intelligence MCQ Questions & Answers - NextProgramming.pdf
100+ Artificial Intelligence MCQ Questions & Answers - NextProgramming.pdf100+ Artificial Intelligence MCQ Questions & Answers - NextProgramming.pdf
100+ Artificial Intelligence MCQ Questions & Answers - NextProgramming.pdfkaxeca4096
 
A Reference Architecture for IoT
A Reference Architecture for IoT A Reference Architecture for IoT
A Reference Architecture for IoT WSO2
 
Implicit Human-Computer Interaction - Lecture 11 - Next Generation User Inter...
Implicit Human-Computer Interaction - Lecture 11 - Next Generation User Inter...Implicit Human-Computer Interaction - Lecture 11 - Next Generation User Inter...
Implicit Human-Computer Interaction - Lecture 11 - Next Generation User Inter...Beat Signer
 
ChatGPT: Revolutionizing Language Processing
ChatGPT: Revolutionizing Language ProcessingChatGPT: Revolutionizing Language Processing
ChatGPT: Revolutionizing Language ProcessingNihil Yuqii
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial IntelligenceMhd Sb
 
IOT-internet of thing
IOT-internet of thingIOT-internet of thing
IOT-internet of thingVISHALJAT3
 
Simplified Introduction to AI
Simplified Introduction to AISimplified Introduction to AI
Simplified Introduction to AIDeepu S Nath
 

Was ist angesagt? (20)

presentation on Edge computing
presentation on Edge computingpresentation on Edge computing
presentation on Edge computing
 
NEUROMORPHIC COMPUTING.pdf
NEUROMORPHIC COMPUTING.pdfNEUROMORPHIC COMPUTING.pdf
NEUROMORPHIC COMPUTING.pdf
 
Semi-supervised Machine Learning
Semi-supervised Machine LearningSemi-supervised Machine Learning
Semi-supervised Machine Learning
 
Introduction to Qiskit
Introduction to QiskitIntroduction to Qiskit
Introduction to Qiskit
 
Inteligencia Artificial.
Inteligencia Artificial.Inteligencia Artificial.
Inteligencia Artificial.
 
Quantum mechanics in electronics
Quantum mechanics in electronicsQuantum mechanics in electronics
Quantum mechanics in electronics
 
Quantum computing
Quantum computingQuantum computing
Quantum computing
 
AI: AI & Problem Solving
AI: AI & Problem SolvingAI: AI & Problem Solving
AI: AI & Problem Solving
 
Seminar report on quantum computing
Seminar report on quantum computingSeminar report on quantum computing
Seminar report on quantum computing
 
100+ Artificial Intelligence MCQ Questions & Answers - NextProgramming.pdf
100+ Artificial Intelligence MCQ Questions & Answers - NextProgramming.pdf100+ Artificial Intelligence MCQ Questions & Answers - NextProgramming.pdf
100+ Artificial Intelligence MCQ Questions & Answers - NextProgramming.pdf
 
A Reference Architecture for IoT
A Reference Architecture for IoT A Reference Architecture for IoT
A Reference Architecture for IoT
 
Chapter 1 (final)
Chapter 1 (final)Chapter 1 (final)
Chapter 1 (final)
 
Implicit Human-Computer Interaction - Lecture 11 - Next Generation User Inter...
Implicit Human-Computer Interaction - Lecture 11 - Next Generation User Inter...Implicit Human-Computer Interaction - Lecture 11 - Next Generation User Inter...
Implicit Human-Computer Interaction - Lecture 11 - Next Generation User Inter...
 
ChatGPT: Revolutionizing Language Processing
ChatGPT: Revolutionizing Language ProcessingChatGPT: Revolutionizing Language Processing
ChatGPT: Revolutionizing Language Processing
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
 
Nano computing.
Nano computing.Nano computing.
Nano computing.
 
Ai 01 introduction
Ai 01 introductionAi 01 introduction
Ai 01 introduction
 
Unlocking the Power of ChatGPT
Unlocking the Power of ChatGPTUnlocking the Power of ChatGPT
Unlocking the Power of ChatGPT
 
IOT-internet of thing
IOT-internet of thingIOT-internet of thing
IOT-internet of thing
 
Simplified Introduction to AI
Simplified Introduction to AISimplified Introduction to AI
Simplified Introduction to AI
 

Andere mochten auch

7 ineffective coding habits many F# programmers don't have
7 ineffective coding habits many F# programmers don't have7 ineffective coding habits many F# programmers don't have
7 ineffective coding habits many F# programmers don't haveYan Cui
 
Andreas Tschas - Pioneers - Building Startup Marketplaces in Europe & Asia - ...
Andreas Tschas - Pioneers - Building Startup Marketplaces in Europe & Asia - ...Andreas Tschas - Pioneers - Building Startup Marketplaces in Europe & Asia - ...
Andreas Tschas - Pioneers - Building Startup Marketplaces in Europe & Asia - ...Burton Lee
 
data science @NYT ; inaugural Data Science Initiative Lecture
data science @NYT ; inaugural Data Science Initiative Lecturedata science @NYT ; inaugural Data Science Initiative Lecture
data science @NYT ; inaugural Data Science Initiative Lecturechris wiggins
 
Pollen VC Building A Digital Lending Business
Pollen VC Building A Digital Lending BusinessPollen VC Building A Digital Lending Business
Pollen VC Building A Digital Lending BusinessPollen VC
 
The Future Of Work & The Work Of The Future
The Future Of Work & The Work Of The FutureThe Future Of Work & The Work Of The Future
The Future Of Work & The Work Of The FutureArturo Pelayo
 

Andere mochten auch (6)

7 ineffective coding habits many F# programmers don't have
7 ineffective coding habits many F# programmers don't have7 ineffective coding habits many F# programmers don't have
7 ineffective coding habits many F# programmers don't have
 
Enabling Autonomy
Enabling AutonomyEnabling Autonomy
Enabling Autonomy
 
Andreas Tschas - Pioneers - Building Startup Marketplaces in Europe & Asia - ...
Andreas Tschas - Pioneers - Building Startup Marketplaces in Europe & Asia - ...Andreas Tschas - Pioneers - Building Startup Marketplaces in Europe & Asia - ...
Andreas Tschas - Pioneers - Building Startup Marketplaces in Europe & Asia - ...
 
data science @NYT ; inaugural Data Science Initiative Lecture
data science @NYT ; inaugural Data Science Initiative Lecturedata science @NYT ; inaugural Data Science Initiative Lecture
data science @NYT ; inaugural Data Science Initiative Lecture
 
Pollen VC Building A Digital Lending Business
Pollen VC Building A Digital Lending BusinessPollen VC Building A Digital Lending Business
Pollen VC Building A Digital Lending Business
 
The Future Of Work & The Work Of The Future
The Future Of Work & The Work Of The FutureThe Future Of Work & The Work Of The Future
The Future Of Work & The Work Of The Future
 

Ähnlich wie CSS Grid Layout

CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout Rachel Andrew
 
Introduction to CSS Grid Layout
Introduction to CSS Grid LayoutIntroduction to CSS Grid Layout
Introduction to CSS Grid LayoutRachel Andrew
 
CSS Grid Layout for Topconf, Linz
CSS Grid Layout for Topconf, LinzCSS Grid Layout for Topconf, Linz
CSS Grid Layout for Topconf, LinzRachel Andrew
 
An Event Apart SF: CSS Grid Layout
An Event Apart SF: CSS Grid LayoutAn Event Apart SF: CSS Grid Layout
An Event Apart SF: CSS Grid LayoutRachel Andrew
 
Devoxx Belgium: CSS Grid Layout
Devoxx Belgium: CSS Grid LayoutDevoxx Belgium: CSS Grid Layout
Devoxx Belgium: CSS Grid LayoutRachel Andrew
 
An Event Apart Nashville: CSS Grid Layout
An Event Apart Nashville: CSS Grid LayoutAn Event Apart Nashville: CSS Grid Layout
An Event Apart Nashville: CSS Grid LayoutRachel Andrew
 
Flexbox and Grid Layout
Flexbox and Grid LayoutFlexbox and Grid Layout
Flexbox and Grid LayoutRachel Andrew
 
Introducing CSS Grid Layout
Introducing CSS Grid LayoutIntroducing CSS Grid Layout
Introducing CSS Grid LayoutRachel Andrew
 
CSS Grid Layout - All Things Open
CSS Grid Layout - All Things OpenCSS Grid Layout - All Things Open
CSS Grid Layout - All Things OpenRachel Andrew
 
CSS Grid Layout for Frontend NE
CSS Grid Layout for Frontend NECSS Grid Layout for Frontend NE
CSS Grid Layout for Frontend NERachel Andrew
 
Start Using CSS Grid Layout Today - RuhrJS
Start Using CSS Grid Layout Today - RuhrJSStart Using CSS Grid Layout Today - RuhrJS
Start Using CSS Grid Layout Today - RuhrJSRachel Andrew
 
Talk Web Design: Get Ready For CSS Grid Layout
Talk Web Design: Get Ready For CSS Grid LayoutTalk Web Design: Get Ready For CSS Grid Layout
Talk Web Design: Get Ready For CSS Grid LayoutRachel Andrew
 
What I discovered about layout vis CSS Grid
What I discovered about layout vis CSS GridWhat I discovered about layout vis CSS Grid
What I discovered about layout vis CSS GridRachel Andrew
 
CSS Grid Layout - An Event Apart Orlando
CSS Grid Layout - An Event Apart OrlandoCSS Grid Layout - An Event Apart Orlando
CSS Grid Layout - An Event Apart OrlandoRachel Andrew
 
Grid and Flexbox - Smashing Conf SF
Grid and Flexbox - Smashing Conf SFGrid and Flexbox - Smashing Conf SF
Grid and Flexbox - Smashing Conf SFRachel Andrew
 
Laying out the future with grid & flexbox - Smashing Conf Freiburg
Laying out the future with grid & flexbox - Smashing Conf FreiburgLaying out the future with grid & flexbox - Smashing Conf Freiburg
Laying out the future with grid & flexbox - Smashing Conf FreiburgRachel Andrew
 
Making the most of New CSS Layout
Making the most of New CSS LayoutMaking the most of New CSS Layout
Making the most of New CSS LayoutRachel Andrew
 
The Grid - The Future of CSS Layout
The Grid - The Future of CSS LayoutThe Grid - The Future of CSS Layout
The Grid - The Future of CSS LayoutRonny Siikaluoma
 

Ähnlich wie CSS Grid Layout (20)

CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout
 
Introduction to CSS Grid Layout
Introduction to CSS Grid LayoutIntroduction to CSS Grid Layout
Introduction to CSS Grid Layout
 
CSS Grid Layout for Topconf, Linz
CSS Grid Layout for Topconf, LinzCSS Grid Layout for Topconf, Linz
CSS Grid Layout for Topconf, Linz
 
An Event Apart SF: CSS Grid Layout
An Event Apart SF: CSS Grid LayoutAn Event Apart SF: CSS Grid Layout
An Event Apart SF: CSS Grid Layout
 
Devoxx Belgium: CSS Grid Layout
Devoxx Belgium: CSS Grid LayoutDevoxx Belgium: CSS Grid Layout
Devoxx Belgium: CSS Grid Layout
 
An Event Apart Nashville: CSS Grid Layout
An Event Apart Nashville: CSS Grid LayoutAn Event Apart Nashville: CSS Grid Layout
An Event Apart Nashville: CSS Grid Layout
 
Flexbox and Grid Layout
Flexbox and Grid LayoutFlexbox and Grid Layout
Flexbox and Grid Layout
 
Introducing CSS Grid Layout
Introducing CSS Grid LayoutIntroducing CSS Grid Layout
Introducing CSS Grid Layout
 
CSS Grid Layout - All Things Open
CSS Grid Layout - All Things OpenCSS Grid Layout - All Things Open
CSS Grid Layout - All Things Open
 
CSS Grid Layout
CSS Grid LayoutCSS Grid Layout
CSS Grid Layout
 
CSS Grid
CSS GridCSS Grid
CSS Grid
 
CSS Grid Layout for Frontend NE
CSS Grid Layout for Frontend NECSS Grid Layout for Frontend NE
CSS Grid Layout for Frontend NE
 
Start Using CSS Grid Layout Today - RuhrJS
Start Using CSS Grid Layout Today - RuhrJSStart Using CSS Grid Layout Today - RuhrJS
Start Using CSS Grid Layout Today - RuhrJS
 
Talk Web Design: Get Ready For CSS Grid Layout
Talk Web Design: Get Ready For CSS Grid LayoutTalk Web Design: Get Ready For CSS Grid Layout
Talk Web Design: Get Ready For CSS Grid Layout
 
What I discovered about layout vis CSS Grid
What I discovered about layout vis CSS GridWhat I discovered about layout vis CSS Grid
What I discovered about layout vis CSS Grid
 
CSS Grid Layout - An Event Apart Orlando
CSS Grid Layout - An Event Apart OrlandoCSS Grid Layout - An Event Apart Orlando
CSS Grid Layout - An Event Apart Orlando
 
Grid and Flexbox - Smashing Conf SF
Grid and Flexbox - Smashing Conf SFGrid and Flexbox - Smashing Conf SF
Grid and Flexbox - Smashing Conf SF
 
Laying out the future with grid & flexbox - Smashing Conf Freiburg
Laying out the future with grid & flexbox - Smashing Conf FreiburgLaying out the future with grid & flexbox - Smashing Conf Freiburg
Laying out the future with grid & flexbox - Smashing Conf Freiburg
 
Making the most of New CSS Layout
Making the most of New CSS LayoutMaking the most of New CSS Layout
Making the most of New CSS Layout
 
The Grid - The Future of CSS Layout
The Grid - The Future of CSS LayoutThe Grid - The Future of CSS Layout
The Grid - The Future of CSS Layout
 

Mehr von Rachel Andrew

All Day Hey! Unlocking The Power of CSS Grid Layout
All Day Hey! Unlocking The Power of CSS Grid LayoutAll Day Hey! Unlocking The Power of CSS Grid Layout
All Day Hey! Unlocking The Power of CSS Grid LayoutRachel Andrew
 
SmashingConf SF: Unlocking the Power of CSS Grid Layout
SmashingConf SF: Unlocking the Power of CSS Grid LayoutSmashingConf SF: Unlocking the Power of CSS Grid Layout
SmashingConf SF: Unlocking the Power of CSS Grid LayoutRachel Andrew
 
Unlocking the Power of CSS Grid Layout
Unlocking the Power of CSS Grid LayoutUnlocking the Power of CSS Grid Layout
Unlocking the Power of CSS Grid LayoutRachel Andrew
 
The Creative New World of CSS
The Creative New World of CSSThe Creative New World of CSS
The Creative New World of CSSRachel Andrew
 
Into the Weeds of CSS Layout
Into the Weeds of CSS LayoutInto the Weeds of CSS Layout
Into the Weeds of CSS LayoutRachel Andrew
 
Solving Layout Problems with CSS Grid & Friends - DevFest17
Solving Layout Problems with CSS Grid & Friends - DevFest17Solving Layout Problems with CSS Grid & Friends - DevFest17
Solving Layout Problems with CSS Grid & Friends - DevFest17Rachel Andrew
 
View Source London: Solving Layout Problems with CSS Grid & Friends
View Source London: Solving Layout Problems with CSS Grid & FriendsView Source London: Solving Layout Problems with CSS Grid & Friends
View Source London: Solving Layout Problems with CSS Grid & FriendsRachel Andrew
 
DevFest Nantes - Start Using CSS Grid Layout today
DevFest Nantes - Start Using CSS Grid Layout todayDevFest Nantes - Start Using CSS Grid Layout today
DevFest Nantes - Start Using CSS Grid Layout todayRachel Andrew
 
404.ie: Solving Layout Problems with CSS Grid & Friends
404.ie: Solving Layout Problems with CSS Grid & Friends404.ie: Solving Layout Problems with CSS Grid & Friends
404.ie: Solving Layout Problems with CSS Grid & FriendsRachel Andrew
 
Solving Layout Problems with CSS Grid & Friends - WEBU17
Solving Layout Problems with CSS Grid & Friends - WEBU17Solving Layout Problems with CSS Grid & Friends - WEBU17
Solving Layout Problems with CSS Grid & Friends - WEBU17Rachel Andrew
 
Solving Layout Problems with CSS Grid & Friends - NordicJS
Solving Layout Problems with CSS Grid & Friends - NordicJSSolving Layout Problems with CSS Grid & Friends - NordicJS
Solving Layout Problems with CSS Grid & Friends - NordicJSRachel Andrew
 
Google Developers Experts Summit 2017 - CSS Layout
Google Developers Experts Summit 2017 - CSS Layout Google Developers Experts Summit 2017 - CSS Layout
Google Developers Experts Summit 2017 - CSS Layout Rachel Andrew
 
Web Summer Camp Keynote
Web Summer Camp KeynoteWeb Summer Camp Keynote
Web Summer Camp KeynoteRachel Andrew
 
New CSS Layout Meets the Real World
New CSS Layout Meets the Real WorldNew CSS Layout Meets the Real World
New CSS Layout Meets the Real WorldRachel Andrew
 
An Event Apart DC - New CSS Layout meets the Real World
An Event Apart DC - New CSS Layout meets the Real WorldAn Event Apart DC - New CSS Layout meets the Real World
An Event Apart DC - New CSS Layout meets the Real WorldRachel Andrew
 
Perch, Patterns and Old Browsers
Perch, Patterns and Old BrowsersPerch, Patterns and Old Browsers
Perch, Patterns and Old BrowsersRachel Andrew
 
Evergreen websites for Evergreen browsers
Evergreen websites for Evergreen browsersEvergreen websites for Evergreen browsers
Evergreen websites for Evergreen browsersRachel Andrew
 
Frontend United: Start using CSS Grid Layout today!
Frontend United: Start using CSS Grid Layout today!Frontend United: Start using CSS Grid Layout today!
Frontend United: Start using CSS Grid Layout today!Rachel Andrew
 
Where does CSS come from?
Where does CSS come from?Where does CSS come from?
Where does CSS come from?Rachel Andrew
 

Mehr von Rachel Andrew (20)

All Day Hey! Unlocking The Power of CSS Grid Layout
All Day Hey! Unlocking The Power of CSS Grid LayoutAll Day Hey! Unlocking The Power of CSS Grid Layout
All Day Hey! Unlocking The Power of CSS Grid Layout
 
SmashingConf SF: Unlocking the Power of CSS Grid Layout
SmashingConf SF: Unlocking the Power of CSS Grid LayoutSmashingConf SF: Unlocking the Power of CSS Grid Layout
SmashingConf SF: Unlocking the Power of CSS Grid Layout
 
Unlocking the Power of CSS Grid Layout
Unlocking the Power of CSS Grid LayoutUnlocking the Power of CSS Grid Layout
Unlocking the Power of CSS Grid Layout
 
The Creative New World of CSS
The Creative New World of CSSThe Creative New World of CSS
The Creative New World of CSS
 
Into the Weeds of CSS Layout
Into the Weeds of CSS LayoutInto the Weeds of CSS Layout
Into the Weeds of CSS Layout
 
Solving Layout Problems with CSS Grid & Friends - DevFest17
Solving Layout Problems with CSS Grid & Friends - DevFest17Solving Layout Problems with CSS Grid & Friends - DevFest17
Solving Layout Problems with CSS Grid & Friends - DevFest17
 
Graduating to Grid
Graduating to GridGraduating to Grid
Graduating to Grid
 
View Source London: Solving Layout Problems with CSS Grid & Friends
View Source London: Solving Layout Problems with CSS Grid & FriendsView Source London: Solving Layout Problems with CSS Grid & Friends
View Source London: Solving Layout Problems with CSS Grid & Friends
 
DevFest Nantes - Start Using CSS Grid Layout today
DevFest Nantes - Start Using CSS Grid Layout todayDevFest Nantes - Start Using CSS Grid Layout today
DevFest Nantes - Start Using CSS Grid Layout today
 
404.ie: Solving Layout Problems with CSS Grid & Friends
404.ie: Solving Layout Problems with CSS Grid & Friends404.ie: Solving Layout Problems with CSS Grid & Friends
404.ie: Solving Layout Problems with CSS Grid & Friends
 
Solving Layout Problems with CSS Grid & Friends - WEBU17
Solving Layout Problems with CSS Grid & Friends - WEBU17Solving Layout Problems with CSS Grid & Friends - WEBU17
Solving Layout Problems with CSS Grid & Friends - WEBU17
 
Solving Layout Problems with CSS Grid & Friends - NordicJS
Solving Layout Problems with CSS Grid & Friends - NordicJSSolving Layout Problems with CSS Grid & Friends - NordicJS
Solving Layout Problems with CSS Grid & Friends - NordicJS
 
Google Developers Experts Summit 2017 - CSS Layout
Google Developers Experts Summit 2017 - CSS Layout Google Developers Experts Summit 2017 - CSS Layout
Google Developers Experts Summit 2017 - CSS Layout
 
Web Summer Camp Keynote
Web Summer Camp KeynoteWeb Summer Camp Keynote
Web Summer Camp Keynote
 
New CSS Layout Meets the Real World
New CSS Layout Meets the Real WorldNew CSS Layout Meets the Real World
New CSS Layout Meets the Real World
 
An Event Apart DC - New CSS Layout meets the Real World
An Event Apart DC - New CSS Layout meets the Real WorldAn Event Apart DC - New CSS Layout meets the Real World
An Event Apart DC - New CSS Layout meets the Real World
 
Perch, Patterns and Old Browsers
Perch, Patterns and Old BrowsersPerch, Patterns and Old Browsers
Perch, Patterns and Old Browsers
 
Evergreen websites for Evergreen browsers
Evergreen websites for Evergreen browsersEvergreen websites for Evergreen browsers
Evergreen websites for Evergreen browsers
 
Frontend United: Start using CSS Grid Layout today!
Frontend United: Start using CSS Grid Layout today!Frontend United: Start using CSS Grid Layout today!
Frontend United: Start using CSS Grid Layout today!
 
Where does CSS come from?
Where does CSS come from?Where does CSS come from?
Where does CSS come from?
 

Kürzlich hochgeladen

Phase noise transfer functions.pptx
Phase noise transfer      functions.pptxPhase noise transfer      functions.pptx
Phase noise transfer functions.pptxSaiGouthamSunkara
 
Basic Principle of Electrochemical Sensor
Basic Principle of  Electrochemical SensorBasic Principle of  Electrochemical Sensor
Basic Principle of Electrochemical SensorTanvir Moin
 
Lecture 1: Basics of trigonometry (surveying)
Lecture 1: Basics of trigonometry (surveying)Lecture 1: Basics of trigonometry (surveying)
Lecture 1: Basics of trigonometry (surveying)Bahzad5
 
Design of Clutches and Brakes in Design of Machine Elements.pptx
Design of Clutches and Brakes in Design of Machine Elements.pptxDesign of Clutches and Brakes in Design of Machine Elements.pptx
Design of Clutches and Brakes in Design of Machine Elements.pptxYogeshKumarKJMIT
 
Nodal seismic construction requirements.pptx
Nodal seismic construction requirements.pptxNodal seismic construction requirements.pptx
Nodal seismic construction requirements.pptxwendy cai
 
Graphics Primitives and CG Display Devices
Graphics Primitives and CG Display DevicesGraphics Primitives and CG Display Devices
Graphics Primitives and CG Display DevicesDIPIKA83
 
SATELITE COMMUNICATION UNIT 1 CEC352 REGULATION 2021 PPT BASICS OF SATELITE ....
SATELITE COMMUNICATION UNIT 1 CEC352 REGULATION 2021 PPT BASICS OF SATELITE ....SATELITE COMMUNICATION UNIT 1 CEC352 REGULATION 2021 PPT BASICS OF SATELITE ....
SATELITE COMMUNICATION UNIT 1 CEC352 REGULATION 2021 PPT BASICS OF SATELITE ....santhyamuthu1
 
IT3401-WEB ESSENTIALS PRESENTATIONS.pptx
IT3401-WEB ESSENTIALS PRESENTATIONS.pptxIT3401-WEB ESSENTIALS PRESENTATIONS.pptx
IT3401-WEB ESSENTIALS PRESENTATIONS.pptxSAJITHABANUS
 
Guardians and Glitches: Navigating the Duality of Gen AI in AppSec
Guardians and Glitches: Navigating the Duality of Gen AI in AppSecGuardians and Glitches: Navigating the Duality of Gen AI in AppSec
Guardians and Glitches: Navigating the Duality of Gen AI in AppSecTrupti Shiralkar, CISSP
 
Mohs Scale of Hardness, Hardness Scale.pptx
Mohs Scale of Hardness, Hardness Scale.pptxMohs Scale of Hardness, Hardness Scale.pptx
Mohs Scale of Hardness, Hardness Scale.pptxKISHAN KUMAR
 
sdfsadopkjpiosufoiasdoifjasldkjfl a asldkjflaskdjflkjsdsdf
sdfsadopkjpiosufoiasdoifjasldkjfl a asldkjflaskdjflkjsdsdfsdfsadopkjpiosufoiasdoifjasldkjfl a asldkjflaskdjflkjsdsdf
sdfsadopkjpiosufoiasdoifjasldkjfl a asldkjflaskdjflkjsdsdfJulia Kaye
 
The relationship between iot and communication technology
The relationship between iot and communication technologyThe relationship between iot and communication technology
The relationship between iot and communication technologyabdulkadirmukarram03
 
Vertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptx
Vertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptxVertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptx
Vertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptxLMW Machine Tool Division
 
Renewable Energy & Entrepreneurship Workshop_21Feb2024.pdf
Renewable Energy & Entrepreneurship Workshop_21Feb2024.pdfRenewable Energy & Entrepreneurship Workshop_21Feb2024.pdf
Renewable Energy & Entrepreneurship Workshop_21Feb2024.pdfodunowoeminence2019
 
GENERAL CONDITIONS FOR CONTRACTS OF CIVIL ENGINEERING WORKS
GENERAL CONDITIONS  FOR  CONTRACTS OF CIVIL ENGINEERING WORKS GENERAL CONDITIONS  FOR  CONTRACTS OF CIVIL ENGINEERING WORKS
GENERAL CONDITIONS FOR CONTRACTS OF CIVIL ENGINEERING WORKS Bahzad5
 
Quasi-Stochastic Approximation: Algorithm Design Principles with Applications...
Quasi-Stochastic Approximation: Algorithm Design Principles with Applications...Quasi-Stochastic Approximation: Algorithm Design Principles with Applications...
Quasi-Stochastic Approximation: Algorithm Design Principles with Applications...Sean Meyn
 
EPE3163_Hydro power stations_Unit2_Lect2.pptx
EPE3163_Hydro power stations_Unit2_Lect2.pptxEPE3163_Hydro power stations_Unit2_Lect2.pptx
EPE3163_Hydro power stations_Unit2_Lect2.pptxJoseeMusabyimana
 

Kürzlich hochgeladen (20)

Lecture 4 .pdf
Lecture 4                              .pdfLecture 4                              .pdf
Lecture 4 .pdf
 
Présentation IIRB 2024 Chloe Dufrane.pdf
Présentation IIRB 2024 Chloe Dufrane.pdfPrésentation IIRB 2024 Chloe Dufrane.pdf
Présentation IIRB 2024 Chloe Dufrane.pdf
 
Phase noise transfer functions.pptx
Phase noise transfer      functions.pptxPhase noise transfer      functions.pptx
Phase noise transfer functions.pptx
 
Basic Principle of Electrochemical Sensor
Basic Principle of  Electrochemical SensorBasic Principle of  Electrochemical Sensor
Basic Principle of Electrochemical Sensor
 
Lecture 1: Basics of trigonometry (surveying)
Lecture 1: Basics of trigonometry (surveying)Lecture 1: Basics of trigonometry (surveying)
Lecture 1: Basics of trigonometry (surveying)
 
Design of Clutches and Brakes in Design of Machine Elements.pptx
Design of Clutches and Brakes in Design of Machine Elements.pptxDesign of Clutches and Brakes in Design of Machine Elements.pptx
Design of Clutches and Brakes in Design of Machine Elements.pptx
 
Nodal seismic construction requirements.pptx
Nodal seismic construction requirements.pptxNodal seismic construction requirements.pptx
Nodal seismic construction requirements.pptx
 
Graphics Primitives and CG Display Devices
Graphics Primitives and CG Display DevicesGraphics Primitives and CG Display Devices
Graphics Primitives and CG Display Devices
 
Lecture 2 .pptx
Lecture 2                            .pptxLecture 2                            .pptx
Lecture 2 .pptx
 
SATELITE COMMUNICATION UNIT 1 CEC352 REGULATION 2021 PPT BASICS OF SATELITE ....
SATELITE COMMUNICATION UNIT 1 CEC352 REGULATION 2021 PPT BASICS OF SATELITE ....SATELITE COMMUNICATION UNIT 1 CEC352 REGULATION 2021 PPT BASICS OF SATELITE ....
SATELITE COMMUNICATION UNIT 1 CEC352 REGULATION 2021 PPT BASICS OF SATELITE ....
 
IT3401-WEB ESSENTIALS PRESENTATIONS.pptx
IT3401-WEB ESSENTIALS PRESENTATIONS.pptxIT3401-WEB ESSENTIALS PRESENTATIONS.pptx
IT3401-WEB ESSENTIALS PRESENTATIONS.pptx
 
Guardians and Glitches: Navigating the Duality of Gen AI in AppSec
Guardians and Glitches: Navigating the Duality of Gen AI in AppSecGuardians and Glitches: Navigating the Duality of Gen AI in AppSec
Guardians and Glitches: Navigating the Duality of Gen AI in AppSec
 
Mohs Scale of Hardness, Hardness Scale.pptx
Mohs Scale of Hardness, Hardness Scale.pptxMohs Scale of Hardness, Hardness Scale.pptx
Mohs Scale of Hardness, Hardness Scale.pptx
 
sdfsadopkjpiosufoiasdoifjasldkjfl a asldkjflaskdjflkjsdsdf
sdfsadopkjpiosufoiasdoifjasldkjfl a asldkjflaskdjflkjsdsdfsdfsadopkjpiosufoiasdoifjasldkjfl a asldkjflaskdjflkjsdsdf
sdfsadopkjpiosufoiasdoifjasldkjfl a asldkjflaskdjflkjsdsdf
 
The relationship between iot and communication technology
The relationship between iot and communication technologyThe relationship between iot and communication technology
The relationship between iot and communication technology
 
Vertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptx
Vertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptxVertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptx
Vertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptx
 
Renewable Energy & Entrepreneurship Workshop_21Feb2024.pdf
Renewable Energy & Entrepreneurship Workshop_21Feb2024.pdfRenewable Energy & Entrepreneurship Workshop_21Feb2024.pdf
Renewable Energy & Entrepreneurship Workshop_21Feb2024.pdf
 
GENERAL CONDITIONS FOR CONTRACTS OF CIVIL ENGINEERING WORKS
GENERAL CONDITIONS  FOR  CONTRACTS OF CIVIL ENGINEERING WORKS GENERAL CONDITIONS  FOR  CONTRACTS OF CIVIL ENGINEERING WORKS
GENERAL CONDITIONS FOR CONTRACTS OF CIVIL ENGINEERING WORKS
 
Quasi-Stochastic Approximation: Algorithm Design Principles with Applications...
Quasi-Stochastic Approximation: Algorithm Design Principles with Applications...Quasi-Stochastic Approximation: Algorithm Design Principles with Applications...
Quasi-Stochastic Approximation: Algorithm Design Principles with Applications...
 
EPE3163_Hydro power stations_Unit2_Lect2.pptx
EPE3163_Hydro power stations_Unit2_Lect2.pptxEPE3163_Hydro power stations_Unit2_Lect2.pptx
EPE3163_Hydro power stations_Unit2_Lect2.pptx
 

CSS Grid Layout

  • 1. CSS Grid Layout Rachel Andrew Generate, September 2015
  • 3. The trouble with CSS layout • Floats and clearfix hacks • Absolute positioning means elements are taken out of document flow and risk overlaps • Redundant markup and positioning oddities with display: table • White space issues with inline-block
  • 4. The cost of taming layout methods • Developer hours spent learning non-obvious concepts. • Compromises in terms of document semantics in order to achieve responsive layouts. • Needing to lean on frameworks to help with complex math. • Adding markup to create grids • Using preprocessors to abstract layout hacks
  • 6. Seeing Flexbox as the silver bullet for layout issues is likely to lead us down another path of layout hacks.
  • 7. We need a designed for purpose layout system for the sites and applications we develop today.
  • 9. Our HTML consists of a div with a class of wrapper and six child elements. <div class="wrapper"> <div class="a">A</div> <div class="b">B</div> <div class="c">C</div> <div class="d">D</div> <div class="e">E</div> <div class="f">F</div> </div>
  • 10. To create a grid we use a new value of the display property. display: grid .wrapper { display: grid; }
  • 11. We describe the grid using the new properties: grid-template-columns grid-template-rows .wrapper { display: grid; grid-template-columns: 100px 10px 100px 10px 100px; grid-template-rows: auto 10px auto; }
  • 12. We position items using the new properties: grid-column-start
 grid-column-end
 grid-row-start
 grid-row-end .a { grid-column-start: 1; grid-column-end: 2; grid-row-start: 1; grid-row-end: 2; }
  • 13. To position an item bottom centre, I start at column line 3, this is the line after the gutter track. .b { grid-column-start: 3; grid-column-end: 4; grid-row-start: 3; grid-row-end: 4; }
  • 14. To span more tracks we just change the end row or column line. .b { grid-column-start: 3; grid-column-end: 6; grid-row-start: 3; grid-row-end: 4; }
  • 15. The longhand for line- based placement means up to 4 properties to position each element. .a { grid-column-start: 1; grid-column-end: 2; grid-row-start: 1; grid-row-end: 2; } .b { grid-column-start: 3; grid-column-end: 4; grid-row-start: 3; grid-row-end: 4; }
  • 16. Declare start and end values with grid-column and grid-row. Values are separated by a / symbol. .a { grid-column: 1 / 2; grid-row: 1 / 2; } .b { grid-column: 3 / 6; grid-row: 3 / 4; }
  • 17. Declare all 4 values using the grid-area property. .a { grid-area: 1 / 1 / 2 / 2; } .b { grid-area: 3 / 3 / 4 / 6; }
  • 18. Grid lines relate to writing mode. In a right to left language such as Arabic the first column line is the right-hand line.
  • 20. Grid Lines Lines can be horizontal or vertical. They are referred to by number and can be named. Highlighted is Column Line 2.
  • 21. Grid Track A Grid Track is the space between two Grid Lines. Tracks can be horizontal or vertical (rows or columns). The highlighted Grid Track is between Row Lines 2 and 3.
  • 22. Grid Cell The smallest unit on our grid, a Grid Cell is the space between four Grid Lines. It’s just like a table cell. The highlighted Grid Cell is between row lines 2 and 3 and column lines 2 and 3.
  • 23. Grid Area Any area of the Grid bound by 4 Grid Lines. It can contain many Grid Cells. The highlighted Grid Area is between row lines 1 and 3, column lines 2 and 4.
  • 24. All examples can be found at http://gridbyexample.com. Use Chrome. Enable “Experimental Web Platform Features” flag.
  • 27. The HTML around my page content. The various areas of my page are child elements of a div with a class of wrapper. <div class="wrapper"> <header class="mainheader"></header> <div class="panel"></div> <div class="content"></div> </div>
  • 29. Declaring a grid on wrapper. The grid has three columns, and four rows. .wrapper { width: 100%; max-width: 960px; margin: 0 auto; display: grid; grid-template-columns: 30% 5% 65%; grid-template-rows: 40px auto 20px auto; }
  • 31. Positioning our elements using the grid-column and grid-row shorthand. This is all we need to do to create our layout. .mainheader { grid-column: 1 / 4; grid-row: 2 / 3; } .panel { grid-column: 1 / 2; grid-row: 4 / 5; } .content { grid-column: 3 / 4; grid-row: 4 / 5; }
  • 34. I can add a footer to this layout. <div class="wrapper"> <header class="mainheader"></header> <div class="panel"></div> <div class="content"></div> <footer class="mainfooter"></footer> </div>
  • 35. Positioning the footer between row lines five and six. .mainfooter { grid-column: 1 / 4; grid-row: 5 / 6; }
  • 37. Our grid only has 5 row lines specified - yet we placed an item between row lines 5 and 6. Grid creates an implicit grid line for us. .wrapper { display: grid; grid-template-columns: 30% 5% 65%; grid-template-rows: 40px auto 20px auto; } .mainfooter { grid-column: 1 / 4; grid-row: 5 / 6; }
  • 38. Grid lines can be explicit or implicit • Explicit grid lines are those specified using grid- template-rows or grid-template-columns. • Implicit lines are created when you place something into a row or column track outside of the explicit grid. • You can specify a size with the grid-auto- columns and grid-auto-rows properties.
  • 39. Grid is “table like” however … • Unlike a table for layout Grid does not rely on your content being a particular order in the source.
 • Being entirely described in CSS we can move things around the Grid at different breakpoints, introduce or redefine a Grid for any breakpoint.
  • 40. Power and Responsibility • As with Flexbox you can use your ability to change how things are ordered for good or evil. • Good = creating the most accessible source order and using Grid to get the optimal display for each device. • Bad = using Grid as an excuse to forget about the source. • Terrible - stripping out semantic elements to make everything a child of the grid.
  • 41. Using Grid to order the page elements in a single column for narrow screen widths. .wrapper { display: grid; grid-template-rows: 10px auto 10px auto 10px auto 10px auto; } .mainheader { grid-row: 2 / 3; } .content { grid-row: 4 / 5; } .panel { grid-row: 6 / 7; } .mainfooter { grid-row: 8 / 9; }
  • 43. Redefine the Grid at min- width 550 pixels. Position items as in the earlier example. @media (min-width: 550px) { .wrapper { grid-template-columns: 30% 5% 65%; grid-template-rows: 40px auto 20px auto 20px auto; } .mainheader { grid-column: 1 / 4; grid-row: 2 / 3; } .panel { grid-column: 1 / 2; grid-row: 4 / 5; } .content { grid-column: 3 / 4; grid-row: 4 / 5; } .mainfooter { grid-column: 1 / 4; grid-row: 6 / 7; } }
  • 46. Name lines with the name in square brackets. Remember we name grid lines and not grid tracks. .wrapper { display: grid; grid-template-rows: 10px [row-header-start] auto [row-header-end] 10px [row-content-start] auto [row-content-end] 10px [row-panel-start] auto [row-panel-end] 10px [row-footer-start] auto [row-footer-end]; }
  • 47. Here we are positioning based on line numbers. .mainheader { grid-row: 2 / 3; } .content { grid-row: 4 / 5; } .panel { grid-row: 6 / 7; } .mainfooter { grid-row: 8 / 9; }
  • 48. Here we are positioning by named lines. .mainheader { grid-row: row-header-start / row-header-end ; } .content { grid-row: row-content-start / row-content-end; } .panel { grid-row: row-panel-start / row-panel-end ; } .mainfooter { grid-row: row-footer-start / row-footer-end; }
  • 51. We assign a name to the elements on our page. I am doing this outside of any Media Queries. .mainheader { grid-area: header; } .content { grid-area: content; } .panel { grid-area: sidebar; } .mainfooter { grid-area: footer; }
  • 52. Describe the layout on the parent element using the grid-template-areas property. A period “.” indicates that this grid cell is empty. .wrapper { display: grid; grid-template-rows: 10px auto 10px auto 10px auto 10px auto; grid-template-areas: "." "header" "." "content" "." "sidebar" "." "footer"; }
  • 55. Redefining the template areas for the wider layout. @media (min-width: 550px) { .wrapper { grid-template-columns: 30% 5% 65%; grid-template-rows: 2em auto 1em auto 1em auto; grid-template-areas: ". . ." "header header header" ". . ." "sidebar . content" ". . ." "footer footer footer" } }
  • 58. Another syntax change! The May 15th Editor’s Draft allows for multiple full stop characters to be used to indicate an empty cell. This means you can line up your ascii art more neatly. @media (min-width: 550px) { .wrapper { grid-template-columns: 30% 5% 65%; grid-template-rows: 2em auto 1em auto 1em auto; grid-template-areas: "....... ...... ......." "header header header " "....... ...... ......." "sidebar ...... content" "....... ...... ......." "footer footer footer " } }
  • 60. Named grid areas create four implicit named lines. You can use these in the same way as lines you have explicitly named. .wrapper { grid-template-columns: 30% 5% 65%; grid-template-rows: 2em auto 1em auto 1em auto; grid-template-areas: ". . ." "header header header" ". . ." "sidebar . content" ". . ." "footer footer footer" } .test { z-index: 100; background-color: red; grid-column: content-start / content-end; grid-row: content-start / footer-end; }
  • 62. Items on the Grid can be layered using the z-index property.
  • 63. A 12 column, flexible grid
  • 64. The Bootstrap grid, and those in other frameworks relies on our describing the layout in the markup. <!-- Stack the columns on mobile by making one full-width and the other half-width --> <div class="row"> <div class="col-xs-12 col-md-8">.col-xs-12 .col-md-8</div> <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div> </div> <!-- Columns start at 50% wide on mobile and bump up to 33.3% wide on desktop --> <div class="row"> <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div> <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div> <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div> </div> <!-- Columns are always 50% wide, on mobile and desktop --> <div class="row"> <div class="col-xs-6">.col-xs-6</div> <div class="col-xs-6">.col-xs-6</div> </div>
  • 65. With CSS Grid Layout we describe the layout in the CSS and can redefine that description at any breakpoint.
  • 67. You can use the repeat keyword to repeat all or part of the grid definition. This would create 4 200 pixel wide tracks, separated by a 20 pixel wide gutter track. grid-template-columns: repeat(4, 200px 20px);
  • 68. The fr unit is a flexible length that represents a fraction of the available space in the grid container. grid-template-columns: 5fr 1fr 10fr 1fr 5fr;
  • 69. We can give multiple grid lines the same name. This means we can use the span keyword to span n number of lines, rather than specifying a specific grid line. .wrapper { grid-template-columns: repeat(4, [col] 200px [gutter] 20px); } .content { grid-column: col 2 / span gutter 2; }
  • 70. The markup used to create the Grid using the Skeleton framework. Like the Bootstrap Grid and other similar frameworks it requires classes that describe the grid to be added to the markup. <div class="container"> <h1>Skeleton Grid</h1> <div class="example-grid"> <div class="row"> <div class="four columns">Four columns</div> <div class="four columns">Four columns</div> <div class="four columns">Four columns</div> </div> <div class="row"> <div class="eight columns">Eight columns</div> <div class="four columns">Four columns</div> </div> <div class="row"> <div class="three columns">Three columns</div> <div class="three columns">Three columns</div> <div class="three columns">Three columns</div> <div class="three columns">Three columns</div> </div> <div class="row"> <div class="six columns">Six columns</div> <div class="six columns">Six columns</div> </div> </div>
  • 72. When using CSS Grid Layout we have no need to describe our grid in markup. <div class="wrapper skeleton"> <h1 class="header">CSS Grid Layout Version</h1> <div class="box1">Four columns</div> <div class="box2">Four columns</div> <div class="box3">Four columns</div> <div class="box4">Eight columns</div> <div class="box5">Four columns</div> <div class="box6">Three columns</div> <div class="box7">Three columns</div> <div class="box8">Three columns</div> <div class="box9">Three columns</div> <div class="box10">Six columns</div> <div class="box11">Six columns</div> </div>
  • 73. Defining the 12 column grid. The repeat keyword repeats the pattern of columns or rows the number of times specified before the comma. .wrapper { display: grid; grid-template-columns: repeat(11, [col] 4fr [gutter] 3.5fr ) [col] 4fr [gutter]; grid-template-rows: auto repeat(4, [row] auto [gutter] 15px); }
  • 74. Placing box1 on the grid. Multiple lines have the same name. This means we can use the span keyword. Here I place box1 starting at the first line named col, spanning to the 4th line named gutter. In the first row named row, spanning to the first line named gutter. .box1 { grid-column: col / span gutter 4; grid-row: row / span gutter; }
  • 75. Placing box8 on the grid. Starting on column line 7, spanning 3 gutter lines. In the 3rd row named row, spanning 1 gutter line. .box8 { grid-column: col 7 / span gutter 3; grid-row: row 3 / span gutter; }
  • 77. With Grid Layout we can easily span rows just like columns. .box1b { grid-column: col / span gutter 4; grid-row: row / span gutter 2; } .box2b { grid-column: col 5 / span gutter 4; grid-row: row / span gutter 3; }
  • 79. The header and footer span the full grid. The content and panel display side by side. .mainheader { grid-column: col / span gutter 12; grid-row: row /span gutter; } .mainfooter { grid-column: col / span gutter 12; grid-row: row 3 /span gutter; } .content { grid-column: col 5 / span gutter 8; grid-row: row 2 / span gutter; } .panel { grid-column: col / span gutter 4; grid-row: row 2 / span gutter; }
  • 81. The header and footer span the full grid. The content and panel display side by side. .mainheader { grid-column: col / span gutter 12; grid-row: row /span gutter; } .mainfooter { grid-column: col / span gutter 12; grid-row: row 3 /span gutter; } .content { grid-column: col 5 / span gutter 8; grid-row: row 2 / span gutter; } .panel { grid-column: col / span gutter 4; grid-row: row 2 / span gutter; }
  • 82. I change three values to make our panel extend to the foot of the page. .mainheader { grid-column: col / span gutter 12; grid-row: row /span gutter; } .mainfooter { grid-column: col 5 / span gutter 8; grid-row: row 3 /span gutter; } .content { grid-column: col 5 / span gutter 8; grid-row: row 2 / span gutter; } .panel { grid-column: col / span gutter 4; grid-row: row 2 / span gutter 2; }
  • 84. Grid Item Placement Algorithm
  • 85. http://dev.w3.org/csswg/css-grid/#grid-item-placement-algorithm “The following grid item placement algorithm resolves automatic positions of grid items into definite positions, ensuring that every grid item has a well-defined grid area to lay out into.”
  • 87. My markup is an unordered list with a class of wrapper. The first list item contains text. The rest an image. Two list items have a class of ‘wide’. <ul class="wrapper"> <li class="text"><p>…</p></li> <li><img src="../images/balloon1.jpg" alt="hot air balloon" /> <p>Balloons 1</p></li> <li><img src="../images/balloon2.jpg" alt="hot air balloon" /> <p>Balloons 2</p></li> <li><img src="../images/balloon3.jpg" alt="hot air balloon" /> <p>Balloons 3</p></li> <li class="wide"><img src="../images/balloon4.jpg" alt="hot air balloon" /> <p>Balloons 4</p></li> <li><img src="../images/balloon5.jpg" alt="hot air balloon" /> <p>Balloons 5</p></li> <li><img src="../images/balloon6.jpg" alt="hot air balloon" /> <p>Balloons 6</p></li> <li class="wide"><img src="../images/balloon7.jpg" alt="hot air balloon" /> <p>Balloons 7</p></li> <li><img src="../images/balloon8.jpg" alt="hot air balloon" /> <p>Balloons 8</p></li> </ul>
  • 89. Narrow screen layout, before any media queries. A single column, single row grid. Grid layout will create implicit rows for any additional list items. .wrapper { display: grid; grid-template-columns: 1fr; grid-template-rows: auto; grid-auto-flow: dense; }
  • 91. At a 460 pixel breakpoint we redefine the grid to have two equal columns. With grid-auto-flow set to dense gaps are not left in the grid if they can be filled. @media (min-width: 460px) { .wrapper { grid-template-columns: 1fr 1fr; } .text { grid-column: 1 / 3; } .wide { grid-column: auto / span 2; } }
  • 93. We move to 4 equal columns at 660 pixels. I position the li with a class of text between column lines 2 and 4, and row lines 1 and 3. @media (min-width: 660px) { .wrapper { grid-template-columns: 1fr 1fr 1fr 1fr; } .text { grid-column: 2 / 4; grid-row: 1 / 3; } }
  • 95. The complete CSS for this grid. .wrapper { display: grid; max-width: 960px; grid-template-columns: 1fr; grid-template-rows: auto; grid-auto-flow: dense; } @media (min-width: 460px) { .wrapper { grid-template-columns: 1fr 1fr; } .text { grid-column: 1 / 3; } .wide { grid-column: auto / span 2; } } @media (min-width: 660px) { .wrapper { grid-template-columns: 1fr 1fr 1fr 1fr; } .text { grid-column: 2 / 4; grid-row: 1 / 3; } }
  • 96. We change the value of grid-auto-flow to sparse. .wrapper { display: grid; max-width: 960px; grid-template-columns: 1fr; grid-template-rows: auto; grid-auto-flow: sparse; } @media (min-width: 460px) { .wrapper { grid-template-columns: 1fr 1fr; } .text { grid-column: 1 / 3; } .wide { grid-column: auto / span 2; } } @media (min-width: 660px) { .wrapper { grid-template-columns: 1fr 1fr 1fr 1fr; } .text { grid-column: 2 / 4; grid-row: 1 / 3; } }
  • 98. We need to talk about Grid
  • 101. Defining the 12 column grid. We define Grid Tracks that will be used as columns, preceded by a line named ‘col’ and those used as gutters, preceded by a line named ‘gutter’. .wrapper { display: grid; grid-template-columns: repeat(11, [col] 4fr [gutter] 3.5fr ) [col] 4fr [gutter]; grid-template-rows: auto repeat(4, [row] auto [gutter] 15px); }
  • 103. Column and Row gaps are now part of the Level 1 Grid Layout specification.
  • 104. Specifying gutters as grid tracks. .wrapper { display: grid; grid-template-columns: repeat(11, [col] 4fr [gutter] 3.5fr ) [col] 4fr [gutter]; grid-template-rows: auto repeat(4, [row] auto [gutter] 15px); }
  • 105. Specifying gutters with the new properties: grid-row-gap grid-column-gap .wrapper { display: grid; grid-column-gap: 1em; grid-row-gap: 1em; grid-template-columns: repeat(12, [col] 4fr ); grid-template-rows: auto; }
  • 106. Nested Grids and Subgrids
  • 107. In this markup the boxes e, f and g are children of the element with a class of d. <div class="wrapper"> <div class="box a">A</div> <div class="box b">B</div> <div class="box c">C</div> <div class="box d"> <div class="box e">E</div> <div class="box f">F</div> <div class="box g">G</div> </div> </div>
  • 108. To make box d a grid itself I declare a grid as normal then position the children of this element. They take their grid lines from the grid declared on box d. .d{ grid-column: col 3 / span gutter 2; grid-row: row 2; display: grid; grid-template-columns: 1fr 10px 1fr; grid-template-rows: auto 10px auto; } .e { grid-column: 1 / 4; grid-row: 1; } .f { grid-column: 1; grid-row: 3; } .g { grid-column: 3; grid-row: 3; }
  • 111. In our existing layout we are creating a completely new grid on box d. .d{ grid-column: col 3 / span gutter 2; grid-row: row 2; display: grid; grid-template-columns: 1fr 10px 1fr; grid-template-rows: auto 10px auto; }
  • 112. If we declare that this grid is a subgrid, we can then position the children of this element on the same grid their parent is placed on. .d{ grid-column: col 3 / span gutter 2; grid-row: row 2; display: grid; grid-template-columns: subgrid; grid-template-rows: subgrid; }
  • 113. http://dev.w3.org/csswg/css-grid/ “The following features are at-risk, and may be dropped during the CR period: the subgrid value of grid-template-columns and grid-template-rows, and its component parts individually”
  • 114. Without subgrid we create the potential for accessibility problems. Authors may remove semantic markup in order to use grid layout.
  • 117. Grid needs your feedback! Enable Experimental Web Platform Features in Chrome. Play with my examples and think up ways you would use Grid. Blog, make examples, point out problems. Follow the CSS Grid conversation on www-style by searching for [css-grid]. See the current issues in the Editor’s Draft http://dev.w3.org/ csswg/css-grid/#issues-index
  • 118. Browser Support All my examples work in Chrome unprefixed - you need to enable the Experimental Web Platform Features flag. You can also use Webkit nightlies, with the -webkit prefix. The work in Blink and Webkit is being done by Igalia, sponsored by Bloomberg. IE10 and up has support for the old syntax, with an -ms prefix. Grid is on the Edge backlog, marked as High Priority. Mozilla are currently implementing Grid in Firefox. There is a Polyfill under active development: https://github.com/ FremyCompany/css-grid-polyfill/
  • 119. All examples can be found at http://gridbyexample.com. Use Chrome. Enable “Experimental Web Platform Features” flag.