SlideShare a Scribd company logo
Advanced CSS Tutorial
Including Flexbox, Grid, and Practical
Examples
What is Advanced CSS?
• Advanced CSS includes powerful layout and
design techniques such as Flexbox, Grid,
Transitions, Animations, and Media Queries.
CSS Selectors
• Advanced selectors include:
• - Attribute selectors [type='text']
• - Pseudo-classes :hover, :nth-child(n)
• - Pseudo-elements ::before, ::after
CSS Specificity
• Specificity determines which rule takes
precedence.
• Inline > ID > Class > Element
• Use specificity calculators to debug complex
rules.
Responsive Design
• Use media queries to create responsive
layouts:
• @media (max-width: 600px) {
• body { background: lightblue; }
• }
CSS Variables
• :root {
• --main-color: blue;
• }
• Usage:
• color: var(--main-color);
Flexbox Introduction
• Flexbox is a layout model that arranges
elements in rows or columns with control over
alignment, direction, and spacing.
Flex Container Properties
• display: flex;
• flex-direction: row | column;
• justify-content: center | space-between;
• align-items: center;
Flex Item Properties
• flex-grow, flex-shrink, and flex-basis define
how a flex item behaves in the flex container.
Flexbox Example
• HTML:
• <div class='flex'>
• <div>1</div><div>2</div><div>3</div>
• </div>
• CSS:
• .flex {
• display: flex;
• justify-content: space-around;
Grid Introduction
• CSS Grid Layout provides a two-dimensional
layout system for the web.
Grid Container Properties
• display: grid;
• grid-template-columns: 1fr 1fr;
• grid-gap: 10px;
Grid Item Properties
• grid-column: 1 / 3;
• grid-row: 2 / 4;
Grid Layout Example
• HTML:
• <div class='grid'>...</div>
• CSS:
• .grid {
• display: grid;
• grid-template-columns: repeat(3, 1fr);
• }
CSS Transitions
• button {
• transition: background 0.3s ease;
• }
• button:hover {
• background: red;
• }
CSS Animations
• @keyframes slideIn {
• from { transform: translateX(-100%); }
• to { transform: translateX(0); }
• }
• div {
• animation: slideIn 1s ease-out;
• }
Z-Index and Stacking Context
• Z-index controls the vertical stacking order of
elements.
• Higher values are in front.
CSS Positioning
• Static, Relative, Absolute, Fixed, Sticky
positioning affects how an element is placed.
Practical Project: Card Layout
• Use Flexbox to create a responsive card layout
with image, title, and description.
Practical Project: Responsive
Navbar
• Use Flexbox and media queries to build a
responsive navigation bar that collapses on
small screens.
Resources and Practice
• - MDN Web Docs
• - W3Schools CSS Exercises
• - Flexbox Froggy & Grid Garden
• - Practice building real layouts

More Related Content

PDF
Render Conf: Start using CSS Grid Layout Today
PDF
DevFest Nantes - Start Using CSS Grid Layout today
PPTX
Full Stack Development CSS_Layouts,Grid,FlexboxPPT.pptx
PDF
New CSS Meets the Real World
PDF
Grid and Flexbox - Smashing Conf SF
PDF
Frontend United: Start using CSS Grid Layout today!
PDF
An Event Apart Seattle - New CSS Layout Meets the Real World
PDF
CSS - OOCSS, SMACSS and more
Render Conf: Start using CSS Grid Layout Today
DevFest Nantes - Start Using CSS Grid Layout today
Full Stack Development CSS_Layouts,Grid,FlexboxPPT.pptx
New CSS Meets the Real World
Grid and Flexbox - Smashing Conf SF
Frontend United: Start using CSS Grid Layout today!
An Event Apart Seattle - New CSS Layout Meets the Real World
CSS - OOCSS, SMACSS and more

Similar to Advanced css for designing responsive web page on website (20)

PDF
New CSS Layout Meets the Real World
PDF
An Event Apart DC - New CSS Layout meets the Real World
PDF
The Future State of Layout
PPTX
MTA css layouts
PDF
Start Using CSS Grid Layout Today - RuhrJS
PDF
Post-Modern CSS: Start learning CSS Grid, Flexbox and other new properties
PDF
Evergreen websites for Evergreen browsers
PDF
Laying out the future with grid & flexbox - Smashing Conf Freiburg
PDF
Flexbox, Grid and Sass
PDF
Better Layouts with Flexbox + CSS Grids
PDF
CSS3 Layout
PPTX
Layouts Part 2
PDF
The Future of CSS Layout
PDF
Introduction to CSS3
PDF
CSS Day: CSS Grid Layout
PDF
CSS Lessons Learned the Hard Way (Beyond Tellerand)
PDF
CSS Lessons Learned The Hard Way – Zoe Gillenwater
PDF
CSS vs. JavaScript - Trust vs. Control
PPTX
Css Grid Layout - A Short Introduction - Part 1
PPTX
CSS.pptx
New CSS Layout Meets the Real World
An Event Apart DC - New CSS Layout meets the Real World
The Future State of Layout
MTA css layouts
Start Using CSS Grid Layout Today - RuhrJS
Post-Modern CSS: Start learning CSS Grid, Flexbox and other new properties
Evergreen websites for Evergreen browsers
Laying out the future with grid & flexbox - Smashing Conf Freiburg
Flexbox, Grid and Sass
Better Layouts with Flexbox + CSS Grids
CSS3 Layout
Layouts Part 2
The Future of CSS Layout
Introduction to CSS3
CSS Day: CSS Grid Layout
CSS Lessons Learned the Hard Way (Beyond Tellerand)
CSS Lessons Learned The Hard Way – Zoe Gillenwater
CSS vs. JavaScript - Trust vs. Control
Css Grid Layout - A Short Introduction - Part 1
CSS.pptx
Ad

Recently uploaded (20)

PDF
KodekX | Application Modernization Development
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Electronic commerce courselecture one. Pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Sensors and Actuators in IoT Systems using pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Chapter 2 Digital Image Fundamentals.pdf
PDF
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Transforming Manufacturing operations through Intelligent Integrations
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Telecom Fraud Prevention Guide | Hyperlink InfoSystem
PDF
NewMind AI Monthly Chronicles - July 2025
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
KodekX | Application Modernization Development
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
The Rise and Fall of 3GPP – Time for a Sabbatical?
Electronic commerce courselecture one. Pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
NewMind AI Weekly Chronicles - August'25 Week I
Sensors and Actuators in IoT Systems using pdf
Advanced methodologies resolving dimensionality complications for autism neur...
20250228 LYD VKU AI Blended-Learning.pptx
Chapter 2 Digital Image Fundamentals.pdf
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Transforming Manufacturing operations through Intelligent Integrations
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Spectral efficient network and resource selection model in 5G networks
Telecom Fraud Prevention Guide | Hyperlink InfoSystem
NewMind AI Monthly Chronicles - July 2025
“AI and Expert System Decision Support & Business Intelligence Systems”
Ad

Advanced css for designing responsive web page on website