SlideShare a Scribd company logo
INTRODUCTION TO
CSS GRID
KARA LUTON
@karaluton
Slides available at: http://bit.ly/intro-to-grid
ABOUT ME
Will stop to pet any dog I see
Nashville native
Retired ballerina
Former music publicist
Web Developer at Lewis Communications
Co-organizer for Tech Ladies
WHAT IS CSS GRID?
SO WHY GRID?
“More than a layout module, CSS Grid is an invitation
to reaffirm our original intent with web design and
development: to create accessible, extensible solutions
that bring content to those interested in the best way
possible.
At the core of any front-end web project is a simple
principle: First, make it accessible, then make it
fancy, and make sure the fancy doesn’t break
accessibility.”
Introduction to CSS Grid
TERMS YOU SHOULD
KNOW
GRID TERMINOLOGY
GRID CONTAINER
The element containing the grid,
defined by setting
display: grid;
GRID TERMINOLOGY
GRID ITEM
Any element that is a direct
descendant of the grid container.
GRID TERMINOLOGY
GRID CELL
The intersection between a
grid-row and a grid-column
GRID TERMINOLOGY
GRID AREA
Rectangular area between four
specific grid lines. Can cover one
or more cells.
GRID TERMINOLOGY
GRID TRACK
The space between two grid
lines, either horizontal or
vertical.
GRID TERMINOLOGY
GRID LINE
Horizontal (row) or vertical
(column) line separating the grid
into sections.
GRID TERMINOLOGY
GRID GAP
The empty space between grid
tracks. Commonly called
gutters.
GRID SUPPORT
SETTING UP CSS GRID
<div class="grid">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
<div class="item">4</div>
<div class="item">5</div>
<div class="item">6</div>
</div>
.grid {
display: grid;
}
<div class="grid">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
<div class="item">4</div>
<div class="item">5</div>
<div class="item">6</div>
</div>
.grid {
display: grid;
grid-template-columns: 20rem 20rem 20rem;
}
.grid {
display: grid;
grid-template-columns: repeat(3, 20rem);
}
<div class="grid">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
<div class="item">4</div>
<div class="item">5</div>
<div class="item">6</div>
</div>
.grid {
display: grid;
grid-template-columns: 20rem 20rem 20rem;
grid-gap: 1rem;
}
IMPLICIT VS
EXPLICIT GRID
<div class="grid">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
<div class="item">4</div>
<div class="item">5</div>
<div class="item">6</div>
</div>
.grid {
display: grid;
grid-template-columns: 20rem 20rem 20rem;
grid-gap: 1rem;
}
.grid {
display: grid;
grid-template-columns: 20rem 20rem 20rem;
grid-template-rows: 10rem 15rem;
grid-gap: 1rem;
}
<div class="grid">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
<div class="item">4</div>
<div class="item">5</div>
<div class="item">6</div>
</div>
.grid {
display: grid;
grid-template-columns: 20rem 20rem 20rem;
grid-template-rows: 30rem;
grid-gap: 1rem;
}
.grid {
display: grid;
grid-template-columns: 20rem 20rem 20rem;
grid-template-rows: 15rem;
grid-auto-rows: 15rem;
grid-gap: 1rem;
}
PIXELS, PERCENTAGES +
FRACTIONAL UNITS
<div class="grid">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
<div class="item">4</div>
<div class="item">5</div>
<div class="item">6</div>
</div>
.grid {
display: grid;
grid-template-columns: 25% 25% 25% 25%;
grid-gap: 1rem;
}
<div class="grid">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
<div class="item">4</div>
<div class="item">5</div>
<div class="item">6</div>
</div>
.grid {
display: grid;
grid-template-columns: repeat(3, 10rem);
grid-gap: 1rem;
}
<div class="grid">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
<div class="item">4</div>
<div class="item">5</div>
<div class="item">6</div>
</div>
.grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 10px;
}
.grid {
display: grid;
grid-template-columns: 1fr 2fr 1fr;
grid-gap: 1rem;
}
<div class="grid">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
<div class="item">4</div>
<div class="item">5</div>
<div class="item">6</div>
</div>
.grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 10px;
}
.grid {
display: grid;
grid-template-columns: auto 2fr 1fr;
grid-gap: 1rem;
}
SIZING +PLACING
GRID ITEMS
<div class="grid">
<div class="item">1</div>
<div class="item pupper">/div
div class=item3/div
div class=item4/div
div class=item5/div
div class=item6/div
/div
.grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 10px;
}
.grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 1rem;
}
.pupper {
width: 30rem;
}
.grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 1rem;
}
.pupper {
grid-column: span 2;
}
div class=grid
div class=item1/div
div class=item pupper/div
div class=item3/div
div class=item4/div
div class=item5/div
div class=item6/div
/div
.grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 1rem;
}
.pupper {
grid-column: span 3;
}
.grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 1rem;
grid-auto-flow: dense;
}
.pupper {
grid-column: span 3;
}
div class=grid
div class=item1/div
div class=item pupper/div
div class=item3/div
div class=item4/div
div class=item5/div
div class=item6/div
/div
.grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 1rem;
}
.pupper {
grid-column: span 2;
}
.grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 1rem;
}
.pupper {
grid-column: 1 / 3;
}
GRID TEMPLATE AREAS
div class=grid
div class=item1Sidebar #1/div
div class=item2Doggo ipsum filler/div
div class=item3Another sidebar/div
div class=footerFooter/div
/div
.grid {
display: grid;
grid-template-columns: 1fr 3fr 1fr;
grid-template-rows: 10rem 10rem 5rem;
grid-gap: 1rem;
}
.grid {
display: grid;
grid-template-columns: 1fr 3fr 1fr;
grid-template-rows: 10rem 10rem 5rem;
grid-gap: 1rem;
grid-template-areas:
“sidebar-1 content sidebar-2”
“sidebar-1 content sidebar-2”
“footer footer footer”;
}
div class=grid
div class=item1Sidebar #1/div
div class=item2Doggo ipsum filler/div
div class=item3Another sidebar/div
div class=footerFooter/div
/div
.grid {
display: grid;
grid-template-columns: 1fr 3fr 1fr;
grid-template-rows: 10rem 10rem 5rem;
grid-gap: 1rem;
}
.grid {
display: grid;
grid-template-columns: 1fr 3fr 1fr;
grid-template-rows: 10rem 10rem 5rem;
grid-gap: 1rem;
grid-template-areas:
“sidebar-1 content sidebar-2”
“sidebar-1 content sidebar-2”
“footer footer footer”;
}
.item1 {
grid-area: sidebar-1;
}
.item2 {
grid-area: content;
}
.item3 {
grid-area: sidebar-2;
}
.footer {
grid-area: footer;
}
DEMO TIME!
RESOURCES
● Wes Bos’ CSS Grid
● CSS Grid Garden
● My article on CSS Grid
GRID TUTORIALS
OTHER RESOURCES
● Info on fallbacks for IE: CSS Grid + Autoprefixer
● Grid by Example
WHAT’S NEXT FOR GRID?
● CSS Grid Level 2 Subgrids
@karaluton
Slides available at: http://bit.ly/intro-to-grid

More Related Content

Similar to Introduction to CSS Grid (20)

The multicolumn challenge: accepted!
The multicolumn challenge: accepted!The multicolumn challenge: accepted!
The multicolumn challenge: accepted!
Lorena Ramonda
 
The Responsive Grid & You: Extending Your WordPress Site Across Multiple Dev...
The Responsive Grid & You:  Extending Your WordPress Site Across Multiple Dev...The Responsive Grid & You:  Extending Your WordPress Site Across Multiple Dev...
The Responsive Grid & You: Extending Your WordPress Site Across Multiple Dev...
Jeremy Fuksa
 
Web I - 07 - CSS Frameworks
Web I - 07 - CSS FrameworksWeb I - 07 - CSS Frameworks
Web I - 07 - CSS Frameworks
Randy Connolly
 
Object-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSS
Object-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSSObject-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSS
Object-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSS
Li-Wei Lu
 
CSS Grid Layout. Implementation status and roadmap (Webkit Contributors Meeti...
CSS Grid Layout. Implementation status and roadmap (Webkit Contributors Meeti...CSS Grid Layout. Implementation status and roadmap (Webkit Contributors Meeti...
CSS Grid Layout. Implementation status and roadmap (Webkit Contributors Meeti...
Igalia
 
Grid and Flexbox - Smashing Conf SF
Grid and Flexbox - Smashing Conf SFGrid and Flexbox - Smashing Conf SF
Grid and Flexbox - Smashing Conf SF
Rachel Andrew
 
New layout models on the Web (Mobile World Congress 2014)
New layout models on the Web (Mobile World Congress 2014)New layout models on the Web (Mobile World Congress 2014)
New layout models on the Web (Mobile World Congress 2014)
Igalia
 
CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout
Rachel 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 Grid
Rachel Andrew
 
Render Conf: Start using CSS Grid Layout Today
Render Conf: Start using CSS Grid Layout TodayRender Conf: Start using CSS Grid Layout Today
Render Conf: Start using CSS Grid Layout Today
Rachel Andrew
 
2D Page Layout
2D Page Layout2D Page Layout
2D Page Layout
Unfold UI
 
Would you like some Grids with that?
Would you like some Grids with that?Would you like some Grids with that?
Would you like some Grids with that?
Kianosh Pourian
 
The Future State of Layout
The Future State of LayoutThe Future State of Layout
The Future State of Layout
Stephen Hay
 
CSS Grid Changes Everything About Web Layouts: WordCamp Europe 2017
CSS Grid Changes Everything About Web Layouts: WordCamp Europe 2017CSS Grid Changes Everything About Web Layouts: WordCamp Europe 2017
CSS Grid Changes Everything About Web Layouts: WordCamp Europe 2017
Morten Rand-Hendriksen
 
CSS- Smacss Design Rule
CSS- Smacss Design RuleCSS- Smacss Design Rule
CSS- Smacss Design Rule
皮馬 頑
 
CSS Grid layout - De volta para o futuro
CSS Grid layout - De volta para o futuroCSS Grid layout - De volta para o futuro
CSS Grid layout - De volta para o futuro
Afonso Pacifer
 
Graduating to Grid
Graduating to GridGraduating to Grid
Graduating to Grid
Rachel Andrew
 
CSS Grid Layout
CSS Grid LayoutCSS Grid Layout
CSS Grid Layout
Rachel Andrew
 
Evolution of CSS
Evolution of CSSEvolution of CSS
Evolution of CSS
Ecaterina Moraru (Valica)
 
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
 
The multicolumn challenge: accepted!
The multicolumn challenge: accepted!The multicolumn challenge: accepted!
The multicolumn challenge: accepted!
Lorena Ramonda
 
The Responsive Grid & You: Extending Your WordPress Site Across Multiple Dev...
The Responsive Grid & You:  Extending Your WordPress Site Across Multiple Dev...The Responsive Grid & You:  Extending Your WordPress Site Across Multiple Dev...
The Responsive Grid & You: Extending Your WordPress Site Across Multiple Dev...
Jeremy Fuksa
 
Web I - 07 - CSS Frameworks
Web I - 07 - CSS FrameworksWeb I - 07 - CSS Frameworks
Web I - 07 - CSS Frameworks
Randy Connolly
 
Object-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSS
Object-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSSObject-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSS
Object-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSS
Li-Wei Lu
 
CSS Grid Layout. Implementation status and roadmap (Webkit Contributors Meeti...
CSS Grid Layout. Implementation status and roadmap (Webkit Contributors Meeti...CSS Grid Layout. Implementation status and roadmap (Webkit Contributors Meeti...
CSS Grid Layout. Implementation status and roadmap (Webkit Contributors Meeti...
Igalia
 
Grid and Flexbox - Smashing Conf SF
Grid and Flexbox - Smashing Conf SFGrid and Flexbox - Smashing Conf SF
Grid and Flexbox - Smashing Conf SF
Rachel Andrew
 
New layout models on the Web (Mobile World Congress 2014)
New layout models on the Web (Mobile World Congress 2014)New layout models on the Web (Mobile World Congress 2014)
New layout models on the Web (Mobile World Congress 2014)
Igalia
 
CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout
Rachel 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 Grid
Rachel Andrew
 
Render Conf: Start using CSS Grid Layout Today
Render Conf: Start using CSS Grid Layout TodayRender Conf: Start using CSS Grid Layout Today
Render Conf: Start using CSS Grid Layout Today
Rachel Andrew
 
2D Page Layout
2D Page Layout2D Page Layout
2D Page Layout
Unfold UI
 
Would you like some Grids with that?
Would you like some Grids with that?Would you like some Grids with that?
Would you like some Grids with that?
Kianosh Pourian
 
The Future State of Layout
The Future State of LayoutThe Future State of Layout
The Future State of Layout
Stephen Hay
 
CSS Grid Changes Everything About Web Layouts: WordCamp Europe 2017
CSS Grid Changes Everything About Web Layouts: WordCamp Europe 2017CSS Grid Changes Everything About Web Layouts: WordCamp Europe 2017
CSS Grid Changes Everything About Web Layouts: WordCamp Europe 2017
Morten Rand-Hendriksen
 
CSS- Smacss Design Rule
CSS- Smacss Design RuleCSS- Smacss Design Rule
CSS- Smacss Design Rule
皮馬 頑
 
CSS Grid layout - De volta para o futuro
CSS Grid layout - De volta para o futuroCSS Grid layout - De volta para o futuro
CSS Grid layout - De volta para o futuro
Afonso Pacifer
 
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
 

Recently uploaded (20)

UiPath Community Berlin: Studio Tips & Tricks and UiPath Insights
UiPath Community Berlin: Studio Tips & Tricks and UiPath InsightsUiPath Community Berlin: Studio Tips & Tricks and UiPath Insights
UiPath Community Berlin: Studio Tips & Tricks and UiPath Insights
UiPathCommunity
 
From Legacy to Cloud-Native: A Guide to AWS Modernization.pptx
From Legacy to Cloud-Native: A Guide to AWS Modernization.pptxFrom Legacy to Cloud-Native: A Guide to AWS Modernization.pptx
From Legacy to Cloud-Native: A Guide to AWS Modernization.pptx
Mohammad Jomaa
 
MCP Dev Summit - Pragmatic Scaling of Enterprise GenAI with MCP
MCP Dev Summit - Pragmatic Scaling of Enterprise GenAI with MCPMCP Dev Summit - Pragmatic Scaling of Enterprise GenAI with MCP
MCP Dev Summit - Pragmatic Scaling of Enterprise GenAI with MCP
Sambhav Kothari
 
Agentic AI - The New Era of Intelligence
Agentic AI - The New Era of IntelligenceAgentic AI - The New Era of Intelligence
Agentic AI - The New Era of Intelligence
Muzammil Shah
 
Gihbli AI and Geo sitution |use/misuse of Ai Technology
Gihbli AI and Geo sitution |use/misuse of Ai TechnologyGihbli AI and Geo sitution |use/misuse of Ai Technology
Gihbli AI and Geo sitution |use/misuse of Ai Technology
zainkhurram1111
 
Fully Open-Source Private Clouds: Freedom, Security, and Control
Fully Open-Source Private Clouds: Freedom, Security, and ControlFully Open-Source Private Clouds: Freedom, Security, and Control
Fully Open-Source Private Clouds: Freedom, Security, and Control
ShapeBlue
 
Maxx nft market place new generation nft marketing place
Maxx nft market place new generation nft marketing placeMaxx nft market place new generation nft marketing place
Maxx nft market place new generation nft marketing place
usersalmanrazdelhi
 
Build your own NES Emulator... with Kotlin
Build your own NES Emulator... with KotlinBuild your own NES Emulator... with Kotlin
Build your own NES Emulator... with Kotlin
Artur Skowroński
 
John Carmack’s Slides From His Upper Bound 2025 Talk
John Carmack’s Slides From His Upper Bound 2025 TalkJohn Carmack’s Slides From His Upper Bound 2025 Talk
John Carmack’s Slides From His Upper Bound 2025 Talk
Razin Mustafiz
 
Droidal: AI Agents Revolutionizing Healthcare
Droidal: AI Agents Revolutionizing HealthcareDroidal: AI Agents Revolutionizing Healthcare
Droidal: AI Agents Revolutionizing Healthcare
Droidal LLC
 
SAP Sapphire 2025 ERP1612 Enhancing User Experience with SAP Fiori and AI
SAP Sapphire 2025 ERP1612 Enhancing User Experience with SAP Fiori and AISAP Sapphire 2025 ERP1612 Enhancing User Experience with SAP Fiori and AI
SAP Sapphire 2025 ERP1612 Enhancing User Experience with SAP Fiori and AI
Peter Spielvogel
 
Master tester AI toolbox - Kari Kakkonen at Testaus ja AI 2025 Professio
Master tester AI toolbox - Kari Kakkonen at Testaus ja AI 2025 ProfessioMaster tester AI toolbox - Kari Kakkonen at Testaus ja AI 2025 Professio
Master tester AI toolbox - Kari Kakkonen at Testaus ja AI 2025 Professio
Kari Kakkonen
 
TrustArc Webinar: Mastering Privacy Contracting
TrustArc Webinar: Mastering Privacy ContractingTrustArc Webinar: Mastering Privacy Contracting
TrustArc Webinar: Mastering Privacy Contracting
TrustArc
 
ECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptx
ECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptxECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptx
ECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptx
Jasper Oosterveld
 
Measuring Microsoft 365 Copilot and Gen AI Success
Measuring Microsoft 365 Copilot and Gen AI SuccessMeasuring Microsoft 365 Copilot and Gen AI Success
Measuring Microsoft 365 Copilot and Gen AI Success
Nikki Chapple
 
The 2025 Digital Adoption Blueprint.pptx
The 2025 Digital Adoption Blueprint.pptxThe 2025 Digital Adoption Blueprint.pptx
The 2025 Digital Adoption Blueprint.pptx
aptyai
 
STKI Israel Market Study 2025 final v1 version
STKI Israel Market Study 2025 final v1 versionSTKI Israel Market Study 2025 final v1 version
STKI Israel Market Study 2025 final v1 version
Dr. Jimmy Schwarzkopf
 
Introducing FME Realize: A New Era of Spatial Computing and AR
Introducing FME Realize: A New Era of Spatial Computing and ARIntroducing FME Realize: A New Era of Spatial Computing and AR
Introducing FME Realize: A New Era of Spatial Computing and AR
Safe Software
 
Cyber security cyber security cyber security cyber security cyber security cy...
Cyber security cyber security cyber security cyber security cyber security cy...Cyber security cyber security cyber security cyber security cyber security cy...
Cyber security cyber security cyber security cyber security cyber security cy...
pranavbodhak
 
"AI in the browser: predicting user actions in real time with TensorflowJS", ...
"AI in the browser: predicting user actions in real time with TensorflowJS", ..."AI in the browser: predicting user actions in real time with TensorflowJS", ...
"AI in the browser: predicting user actions in real time with TensorflowJS", ...
Fwdays
 
UiPath Community Berlin: Studio Tips & Tricks and UiPath Insights
UiPath Community Berlin: Studio Tips & Tricks and UiPath InsightsUiPath Community Berlin: Studio Tips & Tricks and UiPath Insights
UiPath Community Berlin: Studio Tips & Tricks and UiPath Insights
UiPathCommunity
 
From Legacy to Cloud-Native: A Guide to AWS Modernization.pptx
From Legacy to Cloud-Native: A Guide to AWS Modernization.pptxFrom Legacy to Cloud-Native: A Guide to AWS Modernization.pptx
From Legacy to Cloud-Native: A Guide to AWS Modernization.pptx
Mohammad Jomaa
 
MCP Dev Summit - Pragmatic Scaling of Enterprise GenAI with MCP
MCP Dev Summit - Pragmatic Scaling of Enterprise GenAI with MCPMCP Dev Summit - Pragmatic Scaling of Enterprise GenAI with MCP
MCP Dev Summit - Pragmatic Scaling of Enterprise GenAI with MCP
Sambhav Kothari
 
Agentic AI - The New Era of Intelligence
Agentic AI - The New Era of IntelligenceAgentic AI - The New Era of Intelligence
Agentic AI - The New Era of Intelligence
Muzammil Shah
 
Gihbli AI and Geo sitution |use/misuse of Ai Technology
Gihbli AI and Geo sitution |use/misuse of Ai TechnologyGihbli AI and Geo sitution |use/misuse of Ai Technology
Gihbli AI and Geo sitution |use/misuse of Ai Technology
zainkhurram1111
 
Fully Open-Source Private Clouds: Freedom, Security, and Control
Fully Open-Source Private Clouds: Freedom, Security, and ControlFully Open-Source Private Clouds: Freedom, Security, and Control
Fully Open-Source Private Clouds: Freedom, Security, and Control
ShapeBlue
 
Maxx nft market place new generation nft marketing place
Maxx nft market place new generation nft marketing placeMaxx nft market place new generation nft marketing place
Maxx nft market place new generation nft marketing place
usersalmanrazdelhi
 
Build your own NES Emulator... with Kotlin
Build your own NES Emulator... with KotlinBuild your own NES Emulator... with Kotlin
Build your own NES Emulator... with Kotlin
Artur Skowroński
 
John Carmack’s Slides From His Upper Bound 2025 Talk
John Carmack’s Slides From His Upper Bound 2025 TalkJohn Carmack’s Slides From His Upper Bound 2025 Talk
John Carmack’s Slides From His Upper Bound 2025 Talk
Razin Mustafiz
 
Droidal: AI Agents Revolutionizing Healthcare
Droidal: AI Agents Revolutionizing HealthcareDroidal: AI Agents Revolutionizing Healthcare
Droidal: AI Agents Revolutionizing Healthcare
Droidal LLC
 
SAP Sapphire 2025 ERP1612 Enhancing User Experience with SAP Fiori and AI
SAP Sapphire 2025 ERP1612 Enhancing User Experience with SAP Fiori and AISAP Sapphire 2025 ERP1612 Enhancing User Experience with SAP Fiori and AI
SAP Sapphire 2025 ERP1612 Enhancing User Experience with SAP Fiori and AI
Peter Spielvogel
 
Master tester AI toolbox - Kari Kakkonen at Testaus ja AI 2025 Professio
Master tester AI toolbox - Kari Kakkonen at Testaus ja AI 2025 ProfessioMaster tester AI toolbox - Kari Kakkonen at Testaus ja AI 2025 Professio
Master tester AI toolbox - Kari Kakkonen at Testaus ja AI 2025 Professio
Kari Kakkonen
 
TrustArc Webinar: Mastering Privacy Contracting
TrustArc Webinar: Mastering Privacy ContractingTrustArc Webinar: Mastering Privacy Contracting
TrustArc Webinar: Mastering Privacy Contracting
TrustArc
 
ECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptx
ECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptxECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptx
ECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptx
Jasper Oosterveld
 
Measuring Microsoft 365 Copilot and Gen AI Success
Measuring Microsoft 365 Copilot and Gen AI SuccessMeasuring Microsoft 365 Copilot and Gen AI Success
Measuring Microsoft 365 Copilot and Gen AI Success
Nikki Chapple
 
The 2025 Digital Adoption Blueprint.pptx
The 2025 Digital Adoption Blueprint.pptxThe 2025 Digital Adoption Blueprint.pptx
The 2025 Digital Adoption Blueprint.pptx
aptyai
 
STKI Israel Market Study 2025 final v1 version
STKI Israel Market Study 2025 final v1 versionSTKI Israel Market Study 2025 final v1 version
STKI Israel Market Study 2025 final v1 version
Dr. Jimmy Schwarzkopf
 
Introducing FME Realize: A New Era of Spatial Computing and AR
Introducing FME Realize: A New Era of Spatial Computing and ARIntroducing FME Realize: A New Era of Spatial Computing and AR
Introducing FME Realize: A New Era of Spatial Computing and AR
Safe Software
 
Cyber security cyber security cyber security cyber security cyber security cy...
Cyber security cyber security cyber security cyber security cyber security cy...Cyber security cyber security cyber security cyber security cyber security cy...
Cyber security cyber security cyber security cyber security cyber security cy...
pranavbodhak
 
"AI in the browser: predicting user actions in real time with TensorflowJS", ...
"AI in the browser: predicting user actions in real time with TensorflowJS", ..."AI in the browser: predicting user actions in real time with TensorflowJS", ...
"AI in the browser: predicting user actions in real time with TensorflowJS", ...
Fwdays
 

Introduction to CSS Grid

  • 1. INTRODUCTION TO CSS GRID KARA LUTON @karaluton Slides available at: http://bit.ly/intro-to-grid
  • 2. ABOUT ME Will stop to pet any dog I see Nashville native Retired ballerina Former music publicist Web Developer at Lewis Communications Co-organizer for Tech Ladies
  • 3. WHAT IS CSS GRID?
  • 5. “More than a layout module, CSS Grid is an invitation to reaffirm our original intent with web design and development: to create accessible, extensible solutions that bring content to those interested in the best way possible. At the core of any front-end web project is a simple principle: First, make it accessible, then make it fancy, and make sure the fancy doesn’t break accessibility.”
  • 8. GRID TERMINOLOGY GRID CONTAINER The element containing the grid, defined by setting display: grid;
  • 9. GRID TERMINOLOGY GRID ITEM Any element that is a direct descendant of the grid container.
  • 10. GRID TERMINOLOGY GRID CELL The intersection between a grid-row and a grid-column
  • 11. GRID TERMINOLOGY GRID AREA Rectangular area between four specific grid lines. Can cover one or more cells.
  • 12. GRID TERMINOLOGY GRID TRACK The space between two grid lines, either horizontal or vertical.
  • 13. GRID TERMINOLOGY GRID LINE Horizontal (row) or vertical (column) line separating the grid into sections.
  • 14. GRID TERMINOLOGY GRID GAP The empty space between grid tracks. Commonly called gutters.
  • 17. <div class="grid"> <div class="item">1</div> <div class="item">2</div> <div class="item">3</div> <div class="item">4</div> <div class="item">5</div> <div class="item">6</div> </div> .grid { display: grid; }
  • 18. <div class="grid"> <div class="item">1</div> <div class="item">2</div> <div class="item">3</div> <div class="item">4</div> <div class="item">5</div> <div class="item">6</div> </div> .grid { display: grid; grid-template-columns: 20rem 20rem 20rem; } .grid { display: grid; grid-template-columns: repeat(3, 20rem); }
  • 19. <div class="grid"> <div class="item">1</div> <div class="item">2</div> <div class="item">3</div> <div class="item">4</div> <div class="item">5</div> <div class="item">6</div> </div> .grid { display: grid; grid-template-columns: 20rem 20rem 20rem; grid-gap: 1rem; }
  • 21. <div class="grid"> <div class="item">1</div> <div class="item">2</div> <div class="item">3</div> <div class="item">4</div> <div class="item">5</div> <div class="item">6</div> </div> .grid { display: grid; grid-template-columns: 20rem 20rem 20rem; grid-gap: 1rem; } .grid { display: grid; grid-template-columns: 20rem 20rem 20rem; grid-template-rows: 10rem 15rem; grid-gap: 1rem; }
  • 22. <div class="grid"> <div class="item">1</div> <div class="item">2</div> <div class="item">3</div> <div class="item">4</div> <div class="item">5</div> <div class="item">6</div> </div> .grid { display: grid; grid-template-columns: 20rem 20rem 20rem; grid-template-rows: 30rem; grid-gap: 1rem; } .grid { display: grid; grid-template-columns: 20rem 20rem 20rem; grid-template-rows: 15rem; grid-auto-rows: 15rem; grid-gap: 1rem; }
  • 24. <div class="grid"> <div class="item">1</div> <div class="item">2</div> <div class="item">3</div> <div class="item">4</div> <div class="item">5</div> <div class="item">6</div> </div> .grid { display: grid; grid-template-columns: 25% 25% 25% 25%; grid-gap: 1rem; }
  • 25. <div class="grid"> <div class="item">1</div> <div class="item">2</div> <div class="item">3</div> <div class="item">4</div> <div class="item">5</div> <div class="item">6</div> </div> .grid { display: grid; grid-template-columns: repeat(3, 10rem); grid-gap: 1rem; }
  • 26. <div class="grid"> <div class="item">1</div> <div class="item">2</div> <div class="item">3</div> <div class="item">4</div> <div class="item">5</div> <div class="item">6</div> </div> .grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 10px; } .grid { display: grid; grid-template-columns: 1fr 2fr 1fr; grid-gap: 1rem; }
  • 27. <div class="grid"> <div class="item">1</div> <div class="item">2</div> <div class="item">3</div> <div class="item">4</div> <div class="item">5</div> <div class="item">6</div> </div> .grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 10px; } .grid { display: grid; grid-template-columns: auto 2fr 1fr; grid-gap: 1rem; }
  • 29. <div class="grid"> <div class="item">1</div> <div class="item pupper">/div div class=item3/div div class=item4/div div class=item5/div div class=item6/div /div .grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 10px; } .grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 1rem; } .pupper { width: 30rem; } .grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 1rem; } .pupper { grid-column: span 2; }
  • 30. div class=grid div class=item1/div div class=item pupper/div div class=item3/div div class=item4/div div class=item5/div div class=item6/div /div .grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 1rem; } .pupper { grid-column: span 3; } .grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 1rem; grid-auto-flow: dense; } .pupper { grid-column: span 3; }
  • 31. div class=grid div class=item1/div div class=item pupper/div div class=item3/div div class=item4/div div class=item5/div div class=item6/div /div .grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 1rem; } .pupper { grid-column: span 2; } .grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 1rem; } .pupper { grid-column: 1 / 3; }
  • 33. div class=grid div class=item1Sidebar #1/div div class=item2Doggo ipsum filler/div div class=item3Another sidebar/div div class=footerFooter/div /div .grid { display: grid; grid-template-columns: 1fr 3fr 1fr; grid-template-rows: 10rem 10rem 5rem; grid-gap: 1rem; } .grid { display: grid; grid-template-columns: 1fr 3fr 1fr; grid-template-rows: 10rem 10rem 5rem; grid-gap: 1rem; grid-template-areas: “sidebar-1 content sidebar-2” “sidebar-1 content sidebar-2” “footer footer footer”; }
  • 34. div class=grid div class=item1Sidebar #1/div div class=item2Doggo ipsum filler/div div class=item3Another sidebar/div div class=footerFooter/div /div .grid { display: grid; grid-template-columns: 1fr 3fr 1fr; grid-template-rows: 10rem 10rem 5rem; grid-gap: 1rem; } .grid { display: grid; grid-template-columns: 1fr 3fr 1fr; grid-template-rows: 10rem 10rem 5rem; grid-gap: 1rem; grid-template-areas: “sidebar-1 content sidebar-2” “sidebar-1 content sidebar-2” “footer footer footer”; } .item1 { grid-area: sidebar-1; } .item2 { grid-area: content; } .item3 { grid-area: sidebar-2; } .footer { grid-area: footer; }
  • 36. RESOURCES ● Wes Bos’ CSS Grid ● CSS Grid Garden ● My article on CSS Grid GRID TUTORIALS OTHER RESOURCES ● Info on fallbacks for IE: CSS Grid + Autoprefixer ● Grid by Example WHAT’S NEXT FOR GRID? ● CSS Grid Level 2 Subgrids
  • 37. @karaluton Slides available at: http://bit.ly/intro-to-grid