SlideShare une entreprise Scribd logo
1  sur  33
Télécharger pour lire hors ligne
CSS Grid
T A B L E L A Y O U T 2 . 0
2
3
Table Layout Grid Frameworks
4
CSS Grid
Grid Terminology
5
6
Grid Container
Grid Item Grid Item Grid Item
Grid Item Grid Item Grid Item
7
Grid Line
Grid Track
Grid Cell
Grid Area
Grid Container Props
8
9
display: grid;
1 0
grid-template-rows / grid-template-columns
Defines the columns and rows of the grid with a space separated list of value. Values represent track size and can be
a px length, percentage, or fraction of free space. Optional names can be given to the generated lines.
grid-template-columns: 40px 50px 1fr 2fr;
grid-column-gap / grid-row-gap
Defines the space between grid tracks.
grid-column-gap: 10px;
grid-row-gap: 15px;
grid-template-rows: [row1-start] 25% [row1-end] 100px [third-line] auto [last-line];
Repeat and minmax functions can also be used for more complex layouts.
grid-template-rows: repeat(4, minmax(20px, 50px) 100px);
1 1
justify-items / align-items
Justify-items aligns a grid items on the row axis, align-items aligns items on the column axis, inside grid cells. Values
can be start, end, center, or stretch (default).
justify-self: start;
justify-self: center;
align-self: end;
align-self: stretch;
justify-content / align-content
Sometimes the total size of your grid might be less than the size of its grid container. This could happen if all of your grid
items are sized with non-flexible units like px. Justify-content will align the grid on the row axis and align-content will align
the grid on the column axis. Values can be start, end, center, stretch, space-around, space-between, space-evenly.
justify-content: start;
justify-content: center;
align-content: space-around;
align-content: space-evenly;
Grid Item Props
1 2
1 3
grid-column-start / grid-column-end / grid-row-start / grid-row-end
Determines a grid item’s location within the grid by referring to specific grid lines. Value can be a number or name
referring to a grid line, “span <number | name>” to span until specified line is hit, or auto.
grid-column-start: 1;
grid-column-end: span col4-start;
grid-row-start: 2
grid-row-end: span 2
justify-self / align-self
Justify-self aligns a grid item on the row axis, align-self aligns on the column axis.
Values can be start, end, center, or stretch (default).
justify-self: start;
justify-self: center;
align-self: end;
align-self: stretch;
Grid Auto Flow
1 4
1 5
grid-auto-flow
If you have grid items that you don't explicitly place on the grid, the auto-placement algorithm kicks in to automatically
place the items. This property controls how the auto-placement algorithm works. It’s similar to flex-direction but with
one special super power.
grid-auto-flow: row;
grid-auto-flow: column;
grid-auto-flow: dense;
Grid Areas
1 6
1 7
grid-template-areas / grid-area
Defines a grid template by referencing the names of the grid areas which are specified with the grid-area property.
Repeating the name of a grid area causes the content to span those cells. A period signifies an empty cell. The syntax
itself provides a visualization of the structure of the grid.
.item-a { grid-area: header; }
.item-b { grid-area: main; }
.item-c { grid-area: sidebar; }
.item-d { grid-area: footer; }
.container {
grid-template-columns: 50px 50px 50px 50px;
grid-template-rows: auto;
grid-template-areas:
"header header header header"
"main main . sidebar"
"footer footer footer footer";
}
1 8
1 9
.header { grid-area: header; }
.main { grid-area: main; }
.sidebar { grid-area: sidebar; }
.footer { grid-area: footer; }
.container {
display: grid;
grid-template-columns: 50px 50px 50px 50px;
grid-template-rows: auto;
grid-template-areas:
"header header header header"
"main main . sidebar"
"footer footer footer footer";
}
2 0
.header { grid-area: header; }
.main { grid-area: main; }
.sidebar { grid-area: sidebar; }
.footer { grid-area: footer; }
.container {
display: grid;
grid-template-columns: 50px 50px 50px 50px;
grid-template-rows: auto;
grid-template-areas:
"header header header header"
"main main . sidebar"
"footer footer footer footer";
}
<div class="container">
<header class="header">Header</header>
<main class="main">Main</main>
<aside class="sidebar">Sidebar</aside>
<footer class="footer">Footer</footer>
</div>
2 1
Table Layout Grid Frameworks CSS Grid
Responsive
2 2
2 3
2 4
.cards {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
grid-gap: 30px;
max-width: 960px;
margin: 0 auto 30px;
}
2 5
.container {
grid-template-columns: 1fr 1fr;
grid-template-rows: auto;
grid-template-areas:
"header header"
"main main”
“sidebar footer”;
@media (——medium-screen) {
grid-template-columns: 1fr 1fr 1fr 1fr;
grid-template-areas:
"header header header header"
"main main . sidebar"
"footer footer footer footer";
}
}
Animation
2 6
2 7
But what about Flex?
2 8
2 9
“The main idea behind the flex layout is to give the container
the ability to alter its items’ width/height (and order) to best
fill the available space (mostly to accommodate to all kind of
display devices and screen sizes).”
— Chris Coyier
3 0
• Flex is one dimensional. Grid is two dimensional.
• A core difference is that Grid’s approach is layout-
first while Flexbox’ approach is content-first.
• If you want to define a layout as a row or a column, that
flexes based on the content inside, then you probably
need flexbox.
• If you want to define a grid and fit content into it in two
dimensions  then  you probably need grid.
But what about Table?
3 1
3 2
Still use tables
…but for tables
3 3
Demo time…
CODEPEN

Contenu connexe

Tendances

CSS Flexbox (flexible box layout)
CSS Flexbox (flexible box layout)CSS Flexbox (flexible box layout)
CSS Flexbox (flexible box layout)Woodridge Software
 
Bootstrap PPT Part - 2
Bootstrap PPT Part - 2Bootstrap PPT Part - 2
Bootstrap PPT Part - 2EPAM Systems
 
Intro to Flexbox - A Magical CSS Property
Intro to Flexbox - A Magical CSS PropertyIntro to Flexbox - A Magical CSS Property
Intro to Flexbox - A Magical CSS PropertyAdam Soucie
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3Doris Chen
 
Introduction to CSS Borders - Lesson 4
Introduction to CSS Borders - Lesson 4Introduction to CSS Borders - Lesson 4
Introduction to CSS Borders - Lesson 4Naresh Sharma
 
JavaScript & Dom Manipulation
JavaScript & Dom ManipulationJavaScript & Dom Manipulation
JavaScript & Dom ManipulationMohammed Arif
 
Bootstrap PPT by Mukesh
Bootstrap PPT by MukeshBootstrap PPT by Mukesh
Bootstrap PPT by MukeshMukesh Kumar
 
CSS Transitions, Transforms, Animations
CSS Transitions, Transforms, Animations CSS Transitions, Transforms, Animations
CSS Transitions, Transforms, Animations Rob LaPlaca
 
Flexbox and Grid Layout
Flexbox and Grid LayoutFlexbox and Grid Layout
Flexbox and Grid LayoutRachel Andrew
 
HTML Block and Inline Elements
HTML Block and Inline ElementsHTML Block and Inline Elements
HTML Block and Inline ElementsWebtech Learning
 
CSS3 Media Queries
CSS3 Media QueriesCSS3 Media Queries
CSS3 Media QueriesRuss Weakley
 
An introduction to bootstrap
An introduction to bootstrapAn introduction to bootstrap
An introduction to bootstrapMind IT Systems
 

Tendances (20)

Css Display Property
Css Display PropertyCss Display Property
Css Display Property
 
Css3
Css3Css3
Css3
 
CSS Flexbox (flexible box layout)
CSS Flexbox (flexible box layout)CSS Flexbox (flexible box layout)
CSS Flexbox (flexible box layout)
 
Css animation
Css animationCss animation
Css animation
 
Html forms
Html formsHtml forms
Html forms
 
Bootstrap PPT Part - 2
Bootstrap PPT Part - 2Bootstrap PPT Part - 2
Bootstrap PPT Part - 2
 
Intro to Flexbox - A Magical CSS Property
Intro to Flexbox - A Magical CSS PropertyIntro to Flexbox - A Magical CSS Property
Intro to Flexbox - A Magical CSS Property
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3
 
Css box-model
Css box-modelCss box-model
Css box-model
 
Css Ppt
Css PptCss Ppt
Css Ppt
 
Introduction to CSS Borders - Lesson 4
Introduction to CSS Borders - Lesson 4Introduction to CSS Borders - Lesson 4
Introduction to CSS Borders - Lesson 4
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
JavaScript & Dom Manipulation
JavaScript & Dom ManipulationJavaScript & Dom Manipulation
JavaScript & Dom Manipulation
 
Bootstrap PPT by Mukesh
Bootstrap PPT by MukeshBootstrap PPT by Mukesh
Bootstrap PPT by Mukesh
 
CSS Transitions, Transforms, Animations
CSS Transitions, Transforms, Animations CSS Transitions, Transforms, Animations
CSS Transitions, Transforms, Animations
 
Flexbox and Grid Layout
Flexbox and Grid LayoutFlexbox and Grid Layout
Flexbox and Grid Layout
 
HTML Block and Inline Elements
HTML Block and Inline ElementsHTML Block and Inline Elements
HTML Block and Inline Elements
 
CSS3 Media Queries
CSS3 Media QueriesCSS3 Media Queries
CSS3 Media Queries
 
Bootstrap ppt
Bootstrap pptBootstrap ppt
Bootstrap ppt
 
An introduction to bootstrap
An introduction to bootstrapAn introduction to bootstrap
An introduction to bootstrap
 

Similaire à CSS Grid

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
 
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
 
CSS Grid Layout - All Things Open
CSS Grid Layout - All Things OpenCSS Grid Layout - All Things Open
CSS Grid Layout - All Things OpenRachel 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
 
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
 
CSS Grid Layout for Frontend NE
CSS Grid Layout for Frontend NECSS Grid Layout for Frontend NE
CSS Grid Layout for Frontend NERachel 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
 
CSS Grid Layout: An Event Apart Boston 2016
CSS Grid Layout: An Event Apart Boston 2016CSS Grid Layout: An Event Apart Boston 2016
CSS Grid Layout: An Event Apart Boston 2016Rachel 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
 
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
 
AEA Chicago CSS Grid Layout
AEA Chicago CSS Grid LayoutAEA Chicago CSS Grid Layout
AEA Chicago CSS Grid LayoutRachel 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
 
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
 

Similaire à CSS Grid (20)

CSS Grid Layout
CSS Grid LayoutCSS Grid Layout
CSS Grid 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
 
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
 
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
 
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
 
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
 
CSS Grid Layout for Frontend NE
CSS Grid Layout for Frontend NECSS Grid Layout for Frontend NE
CSS Grid Layout for Frontend NE
 
17523630.ppt
17523630.ppt17523630.ppt
17523630.ppt
 
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
 
CSS Grid Layout
CSS Grid LayoutCSS Grid Layout
CSS Grid Layout
 
CSS Grid Layout: An Event Apart Boston 2016
CSS Grid Layout: An Event Apart Boston 2016CSS Grid Layout: An Event Apart Boston 2016
CSS Grid Layout: An Event Apart Boston 2016
 
CSS Grid Layout for Topconf, Linz
CSS Grid Layout for Topconf, LinzCSS Grid Layout for Topconf, Linz
CSS Grid Layout for Topconf, Linz
 
CSS Grid for html5j
CSS Grid for html5jCSS Grid for html5j
CSS Grid for html5j
 
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
 
World of CSS Grid
World of CSS GridWorld of CSS Grid
World of CSS Grid
 
AEA Chicago CSS Grid Layout
AEA Chicago CSS Grid LayoutAEA Chicago CSS Grid Layout
AEA Chicago CSS Grid Layout
 
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
 
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
 

Plus de Digital Surgeons

Navigating Your Brand Through Covid-19
Navigating Your Brand Through Covid-19Navigating Your Brand Through Covid-19
Navigating Your Brand Through Covid-19Digital Surgeons
 
Creating great decks: The Origins, the "Why", and 12 Tips to Make Yours Better.
Creating great decks: The Origins, the "Why", and 12 Tips to Make Yours Better.Creating great decks: The Origins, the "Why", and 12 Tips to Make Yours Better.
Creating great decks: The Origins, the "Why", and 12 Tips to Make Yours Better.Digital Surgeons
 
The Science of Story: How Brands Can Use Storytelling To Get More Customers
The Science of Story: How Brands Can Use Storytelling To Get More CustomersThe Science of Story: How Brands Can Use Storytelling To Get More Customers
The Science of Story: How Brands Can Use Storytelling To Get More CustomersDigital Surgeons
 
In Content Strategy, L.E.S.S. is More
In Content Strategy, L.E.S.S. is MoreIn Content Strategy, L.E.S.S. is More
In Content Strategy, L.E.S.S. is MoreDigital Surgeons
 
Unlock Your Organization Through Digital Transformation
Unlock Your Organization Through Digital TransformationUnlock Your Organization Through Digital Transformation
Unlock Your Organization Through Digital TransformationDigital Surgeons
 
Radical Candor: No BS, helping your team create better work.
Radical Candor: No BS, helping your team create better work.Radical Candor: No BS, helping your team create better work.
Radical Candor: No BS, helping your team create better work.Digital Surgeons
 
Unlocking Creativity: How to Harness the Powers of Design, Art Direction & Cr...
Unlocking Creativity: How to Harness the Powers of Design, Art Direction & Cr...Unlocking Creativity: How to Harness the Powers of Design, Art Direction & Cr...
Unlocking Creativity: How to Harness the Powers of Design, Art Direction & Cr...Digital Surgeons
 
Fight for Yourself: How to Sell Your Ideas and Crush Presentations
Fight for Yourself: How to Sell Your Ideas and Crush PresentationsFight for Yourself: How to Sell Your Ideas and Crush Presentations
Fight for Yourself: How to Sell Your Ideas and Crush PresentationsDigital Surgeons
 
Typecurious: A Typography Crash Course
Typecurious: A Typography Crash CourseTypecurious: A Typography Crash Course
Typecurious: A Typography Crash CourseDigital Surgeons
 
Better Twitch Broadcasting through Rapid Prototyping & Human Centered Design
Better Twitch Broadcasting through Rapid Prototyping & Human Centered DesignBetter Twitch Broadcasting through Rapid Prototyping & Human Centered Design
Better Twitch Broadcasting through Rapid Prototyping & Human Centered DesignDigital Surgeons
 
How to Stream Video Games: A Primer on Twitch.tv
How to Stream Video Games: A Primer on Twitch.tvHow to Stream Video Games: A Primer on Twitch.tv
How to Stream Video Games: A Primer on Twitch.tvDigital Surgeons
 
Art, Meet Copy: A Copywriting Primer for Designers
Art, Meet Copy: A Copywriting Primer for Designers Art, Meet Copy: A Copywriting Primer for Designers
Art, Meet Copy: A Copywriting Primer for Designers Digital Surgeons
 
Creating Powerful Customer Experiences
Creating Powerful Customer ExperiencesCreating Powerful Customer Experiences
Creating Powerful Customer ExperiencesDigital Surgeons
 
How to Build a Brand Voice Toolkit
How to Build a Brand Voice ToolkitHow to Build a Brand Voice Toolkit
How to Build a Brand Voice ToolkitDigital Surgeons
 
Design Thinking: The one thing that will transform the way you think
Design Thinking: The one thing that will transform the way you thinkDesign Thinking: The one thing that will transform the way you think
Design Thinking: The one thing that will transform the way you thinkDigital Surgeons
 
What You Need to Know About the Future of Wearable Technology
What You Need to Know About the Future of Wearable TechnologyWhat You Need to Know About the Future of Wearable Technology
What You Need to Know About the Future of Wearable TechnologyDigital Surgeons
 
How YouTube is Drastically Changing the Beauty Industry
How YouTube is Drastically Changing the Beauty IndustryHow YouTube is Drastically Changing the Beauty Industry
How YouTube is Drastically Changing the Beauty IndustryDigital Surgeons
 

Plus de Digital Surgeons (20)

Navigating Your Brand Through Covid-19
Navigating Your Brand Through Covid-19Navigating Your Brand Through Covid-19
Navigating Your Brand Through Covid-19
 
SVG Animations
SVG AnimationsSVG Animations
SVG Animations
 
Machine learning
Machine learningMachine learning
Machine learning
 
CraftCMS 3.x Deep Dive
CraftCMS 3.x Deep DiveCraftCMS 3.x Deep Dive
CraftCMS 3.x Deep Dive
 
Creating great decks: The Origins, the "Why", and 12 Tips to Make Yours Better.
Creating great decks: The Origins, the "Why", and 12 Tips to Make Yours Better.Creating great decks: The Origins, the "Why", and 12 Tips to Make Yours Better.
Creating great decks: The Origins, the "Why", and 12 Tips to Make Yours Better.
 
The Science of Story: How Brands Can Use Storytelling To Get More Customers
The Science of Story: How Brands Can Use Storytelling To Get More CustomersThe Science of Story: How Brands Can Use Storytelling To Get More Customers
The Science of Story: How Brands Can Use Storytelling To Get More Customers
 
In Content Strategy, L.E.S.S. is More
In Content Strategy, L.E.S.S. is MoreIn Content Strategy, L.E.S.S. is More
In Content Strategy, L.E.S.S. is More
 
Unlock Your Organization Through Digital Transformation
Unlock Your Organization Through Digital TransformationUnlock Your Organization Through Digital Transformation
Unlock Your Organization Through Digital Transformation
 
Radical Candor: No BS, helping your team create better work.
Radical Candor: No BS, helping your team create better work.Radical Candor: No BS, helping your team create better work.
Radical Candor: No BS, helping your team create better work.
 
Unlocking Creativity: How to Harness the Powers of Design, Art Direction & Cr...
Unlocking Creativity: How to Harness the Powers of Design, Art Direction & Cr...Unlocking Creativity: How to Harness the Powers of Design, Art Direction & Cr...
Unlocking Creativity: How to Harness the Powers of Design, Art Direction & Cr...
 
Fight for Yourself: How to Sell Your Ideas and Crush Presentations
Fight for Yourself: How to Sell Your Ideas and Crush PresentationsFight for Yourself: How to Sell Your Ideas and Crush Presentations
Fight for Yourself: How to Sell Your Ideas and Crush Presentations
 
Typecurious: A Typography Crash Course
Typecurious: A Typography Crash CourseTypecurious: A Typography Crash Course
Typecurious: A Typography Crash Course
 
Better Twitch Broadcasting through Rapid Prototyping & Human Centered Design
Better Twitch Broadcasting through Rapid Prototyping & Human Centered DesignBetter Twitch Broadcasting through Rapid Prototyping & Human Centered Design
Better Twitch Broadcasting through Rapid Prototyping & Human Centered Design
 
How to Stream Video Games: A Primer on Twitch.tv
How to Stream Video Games: A Primer on Twitch.tvHow to Stream Video Games: A Primer on Twitch.tv
How to Stream Video Games: A Primer on Twitch.tv
 
Art, Meet Copy: A Copywriting Primer for Designers
Art, Meet Copy: A Copywriting Primer for Designers Art, Meet Copy: A Copywriting Primer for Designers
Art, Meet Copy: A Copywriting Primer for Designers
 
Creating Powerful Customer Experiences
Creating Powerful Customer ExperiencesCreating Powerful Customer Experiences
Creating Powerful Customer Experiences
 
How to Build a Brand Voice Toolkit
How to Build a Brand Voice ToolkitHow to Build a Brand Voice Toolkit
How to Build a Brand Voice Toolkit
 
Design Thinking: The one thing that will transform the way you think
Design Thinking: The one thing that will transform the way you thinkDesign Thinking: The one thing that will transform the way you think
Design Thinking: The one thing that will transform the way you think
 
What You Need to Know About the Future of Wearable Technology
What You Need to Know About the Future of Wearable TechnologyWhat You Need to Know About the Future of Wearable Technology
What You Need to Know About the Future of Wearable Technology
 
How YouTube is Drastically Changing the Beauty Industry
How YouTube is Drastically Changing the Beauty IndustryHow YouTube is Drastically Changing the Beauty Industry
How YouTube is Drastically Changing the Beauty Industry
 

Dernier

CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncssuser2ae721
 
computer application and construction management
computer application and construction managementcomputer application and construction management
computer application and construction managementMariconPadriquez1
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleAlluxio, Inc.
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...121011101441
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catcherssdickerson1
 

Dernier (20)

CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
 
computer application and construction management
computer application and construction managementcomputer application and construction management
computer application and construction management
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at Scale
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
 

CSS Grid

  • 1. CSS Grid T A B L E L A Y O U T 2 . 0
  • 2. 2
  • 3. 3 Table Layout Grid Frameworks
  • 6. 6 Grid Container Grid Item Grid Item Grid Item Grid Item Grid Item Grid Item
  • 10. 1 0 grid-template-rows / grid-template-columns Defines the columns and rows of the grid with a space separated list of value. Values represent track size and can be a px length, percentage, or fraction of free space. Optional names can be given to the generated lines. grid-template-columns: 40px 50px 1fr 2fr; grid-column-gap / grid-row-gap Defines the space between grid tracks. grid-column-gap: 10px; grid-row-gap: 15px; grid-template-rows: [row1-start] 25% [row1-end] 100px [third-line] auto [last-line]; Repeat and minmax functions can also be used for more complex layouts. grid-template-rows: repeat(4, minmax(20px, 50px) 100px);
  • 11. 1 1 justify-items / align-items Justify-items aligns a grid items on the row axis, align-items aligns items on the column axis, inside grid cells. Values can be start, end, center, or stretch (default). justify-self: start; justify-self: center; align-self: end; align-self: stretch; justify-content / align-content Sometimes the total size of your grid might be less than the size of its grid container. This could happen if all of your grid items are sized with non-flexible units like px. Justify-content will align the grid on the row axis and align-content will align the grid on the column axis. Values can be start, end, center, stretch, space-around, space-between, space-evenly. justify-content: start; justify-content: center; align-content: space-around; align-content: space-evenly;
  • 13. 1 3 grid-column-start / grid-column-end / grid-row-start / grid-row-end Determines a grid item’s location within the grid by referring to specific grid lines. Value can be a number or name referring to a grid line, “span <number | name>” to span until specified line is hit, or auto. grid-column-start: 1; grid-column-end: span col4-start; grid-row-start: 2 grid-row-end: span 2 justify-self / align-self Justify-self aligns a grid item on the row axis, align-self aligns on the column axis. Values can be start, end, center, or stretch (default). justify-self: start; justify-self: center; align-self: end; align-self: stretch;
  • 15. 1 5 grid-auto-flow If you have grid items that you don't explicitly place on the grid, the auto-placement algorithm kicks in to automatically place the items. This property controls how the auto-placement algorithm works. It’s similar to flex-direction but with one special super power. grid-auto-flow: row; grid-auto-flow: column; grid-auto-flow: dense;
  • 17. 1 7 grid-template-areas / grid-area Defines a grid template by referencing the names of the grid areas which are specified with the grid-area property. Repeating the name of a grid area causes the content to span those cells. A period signifies an empty cell. The syntax itself provides a visualization of the structure of the grid. .item-a { grid-area: header; } .item-b { grid-area: main; } .item-c { grid-area: sidebar; } .item-d { grid-area: footer; } .container { grid-template-columns: 50px 50px 50px 50px; grid-template-rows: auto; grid-template-areas: "header header header header" "main main . sidebar" "footer footer footer footer"; }
  • 18. 1 8
  • 19. 1 9 .header { grid-area: header; } .main { grid-area: main; } .sidebar { grid-area: sidebar; } .footer { grid-area: footer; } .container { display: grid; grid-template-columns: 50px 50px 50px 50px; grid-template-rows: auto; grid-template-areas: "header header header header" "main main . sidebar" "footer footer footer footer"; }
  • 20. 2 0 .header { grid-area: header; } .main { grid-area: main; } .sidebar { grid-area: sidebar; } .footer { grid-area: footer; } .container { display: grid; grid-template-columns: 50px 50px 50px 50px; grid-template-rows: auto; grid-template-areas: "header header header header" "main main . sidebar" "footer footer footer footer"; } <div class="container"> <header class="header">Header</header> <main class="main">Main</main> <aside class="sidebar">Sidebar</aside> <footer class="footer">Footer</footer> </div>
  • 21. 2 1 Table Layout Grid Frameworks CSS Grid
  • 23. 2 3
  • 24. 2 4 .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); grid-gap: 30px; max-width: 960px; margin: 0 auto 30px; }
  • 25. 2 5 .container { grid-template-columns: 1fr 1fr; grid-template-rows: auto; grid-template-areas: "header header" "main main” “sidebar footer”; @media (——medium-screen) { grid-template-columns: 1fr 1fr 1fr 1fr; grid-template-areas: "header header header header" "main main . sidebar" "footer footer footer footer"; } }
  • 27. 2 7
  • 28. But what about Flex? 2 8
  • 29. 2 9 “The main idea behind the flex layout is to give the container the ability to alter its items’ width/height (and order) to best fill the available space (mostly to accommodate to all kind of display devices and screen sizes).” — Chris Coyier
  • 30. 3 0 • Flex is one dimensional. Grid is two dimensional. • A core difference is that Grid’s approach is layout- first while Flexbox’ approach is content-first. • If you want to define a layout as a row or a column, that flexes based on the content inside, then you probably need flexbox. • If you want to define a grid and fit content into it in two dimensions  then  you probably need grid.
  • 31. But what about Table? 3 1
  • 32. 3 2 Still use tables …but for tables