SlideShare a Scribd company logo
Introduction to CSS
The Basics of Creating Web Pages
InfiniteWebSolutions 1
I
W
S
Introduction to CSS
What is CSS?
• Cascading Style Sheets
• CSS is used to control the style and layout of web pages.
InfiniteWebSolutions 2
Without
CSS
With CSS
I
W
S
Purpose
• Separation of Concerns:
Keeps HTML structure and presentation separate.
• Consistency:
Ensures a consistent look across multiple pages.
• Efficiency:
Reuse styles across multiple pages or elements.
InfiniteWebSolutions 3
I
W
S
How CSS Works?
• Selectors:
Target HTML elements.
• Properties:
Define what aspect of the element to style.
• Values:
Specify the style details.
Example:
InfiniteWebSolutions 4
I
W
S
CSS Syntax
• Selector:
HTML element to style.
• Declaration Block:
Contains one or more declarations.
• Declaration:
A property and value pair.
Example:
InfiniteWebSolutions 5
I
W
S
Types of CSS
Inline CSS:
• Styles applied directly within an HTML element.
InfiniteWebSolutions 6
I
W
S
Internal CSS:
• Styles defined within a <style> tag in the HTML
document.
InfiniteWebSolutions 7
I
W
S
External CSS:
• Styles defined in an external .css file linked to the HTML
document.
InfiniteWebSolutions 8
Index.html
Style.css
I
W
S
CSS Selectors
Basic Selectors:
• Element, ID, and Class.
InfiniteWebSolutions 9
Index.html
Style.css
I
W
S
Combinator Selectors:
• Descendant, Child, Adjacent Sibling, General Sibling.
InfiniteWebSolutions 10
Index.html Style.css
I
W
S
Pseudo-class Selectors:
• Hover, Active, First-child, etc.
InfiniteWebSolutions 11
Index.html
Style.css
I
W
S
CSS Box Model
InfiniteWebSolutions 12
I
W
S
InfiniteWebSolutions 13
Components
Index.html
Style.css
I
W
S
CSS Positioning
CSS positioning controls how elements are placed and
layered on a web page.
• Static: Default positioning; elements are placed according
to the normal document flow.
InfiniteWebSolutions 14
I
W
S
• Relative: Elements are positioned relative to their normal
position, with top, right, bottom, and left offsets.
InfiniteWebSolutions 15
I
W
S
• Absolute: Elements are positioned relative to their nearest
positioned ancestor or the initial containing block if none
exists.
InfiniteWebSolutions 16
I
W
S
• Fixed: Elements are positioned relative to the viewport,
remaining in the same place even when scrolling.
InfiniteWebSolutions 17
I
W
S
Sticky: Elements are positioned based on the user's scroll
position, toggling between relative and fixed depending on the
scroll.
InfiniteWebSolutions 18
I
W
S
CSS Flexbox
CSS Flexbox (Flexible Box Layout) is a layout model that allows
you to design complex layouts with ease by aligning and
distributing space among items in a container, even when their
size is unknown or dynamic.
Features:
• Flexible Sizing: Allows items to grow and shrink
proportionally based on available space, making it easy to
create responsive layouts.
• Alignment and Justification: Provides powerful alignment
options, such as justify-content and align-items, to control
the distribution and alignment of items within a container.
• Order Control: Enables reordering of items with the order
property without changing the HTML structure.
InfiniteWebSolutions 19
I
W
S
Basic Flexbox Container
InfiniteWebSolutions 20
I
W
S
Centering Items Horizontally and
Vertically
InfiniteWebSolutions 21
I
W
S
Space between
InfiniteWebSolutions 22
I
W
S
Align Items to the End
InfiniteWebSolutions 23
I
W
S
Wrap items
InfiniteWebSolutions 24
I
W
S
CSS Grid
CSS Grid is a layout system that enables precise and flexible
arrangement of elements in a two-dimensional grid of rows and
columns.
Features:
• Two-Dimensional Layout: Allows simultaneous control over
both rows and columns, providing precise placement of items in
a grid.
• Grid Areas: Enables defining named areas within the grid,
making layout management and item placement
straightforward.
• Flexible Sizing: Supports flexible and adaptive sizing of grid
items using units like fractions (`fr`), and responsive design with
media queries.
InfiniteWebSolutions 25
I
W
S
Grid Types
• Basic Grid Container: Defines a simple grid layout with
equal-width columns.
InfiniteWebSolutions 26
I
W
S
• Explicit Grid: Creates a grid with fixed-size columns.
InfiniteWebSolutions 27
I
W
S
• Fractional Units: Uses fractional units (fr) for flexible
column widths.
InfiniteWebSolutions 28
I
W
S
• Named Areas: Assigns specific grid areas with names for
layout.
InfiniteWebSolutions 29
I
W
S
Responsive Design
Responsive design with CSS adjusts layout and content to fit
different screen sizes and devices using techniques like media
queries and flexible grids.
Media Queries:
• @media (max-width: 600px) { ... }
Flexible Layouts and Units:
• Percentages, em, rem
InfiniteWebSolutions 30
I
W
S
View Port
• viewport is the visible area of a web page on a device screen.
• It represents the portion of the web page currently visible to
the user.
• CSS provides units like vw (viewport width) and vh (viewport
height) to help create responsive designs that adapt to
different screen sizes.
InfiniteWebSolutions 31
I
W
S
Default Break Points
InfiniteWebSolutions 32
I
W
S
Example
InfiniteWebSolutions 33
I
W
S
InfiniteWebSolutions 34
I
W
S
Animations and Transitions
Animations:
• Keyframes to define animation
• @keyframes name { ... }
InfiniteWebSolutions 35
I
W
S
Transitions:
• Smooth change from one style to another
• transition: property duration;
InfiniteWebSolutions 36
I
W
S
CSS Frameworks
CSS frameworks are pre-built libraries that provide
standardized styles and components to accelerate web
development and ensure consistency.
Popular CSS frameworks:
• Bootstrap
• Tailwind CSS
Benefits:
• Speed and Efficiency
• Consistency
• Responsiveness
InfiniteWebSolutions 37
I
W
S
Best Practices
• Maintainability:
Use clear, meaningful class names.
• Reusability:
Use classes and avoid inline styles.
• Performance:
• Minimize CSS, use shorthand properties, etc.
InfiniteWebSolutions 38
I
W
S
Conclusion
• Recap key points about CSS.
• Practice by building small projects, explore
advanced topics like animations.
InfiniteWebSolutions 39
I
W
S
Q&A
Open the Floor for Questions
InfiniteWebSolutions 40

More Related Content

Similar to Mastering CSS: The Foundation of Web Design by Infinite Web Solutions.pptx (20)

PPTX
Advanced CSS.pptx
DiyonaVas
 
KEY
Getting started with CSS frameworks using Zurb foundation
Melanie Archer
 
PPTX
HTML and CSS part 3
Julie Iskander
 
PPTX
cascading style sheet powerpoint notes.pptx
kcdiya58
 
PDF
960 grid psd
Raju Nag
 
PDF
Flexbox, Grid and Sass
Seble Nigussie
 
PPTX
CSS3 PPT.pptx
AchieversIT
 
PDF
CSS3 Layout
Zoe Gillenwater
 
PDF
The Future of CSS Layout
Zoe Gillenwater
 
PPTX
Advanced css for designing responsive web page on website
AbrahamChe2
 
PDF
Web I - 07 - CSS Frameworks
Randy Connolly
 
PPTX
Cascading Style Sheets CSS
Asif Shahzad
 
PDF
CSS - OOCSS, SMACSS and more
Russ Weakley
 
PDF
Organize Your Website With Advanced CSS Tricks
Andolasoft Inc
 
PDF
IV - CSS architecture
WebF
 
PPTX
CSS Basics
Nitin Bhide
 
PDF
Introduction to CSS3
Doris Chen
 
PPTX
Castro Chapter 11
Jeff Byrnes
 
PPT
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
Deepak Sharma
 
Advanced CSS.pptx
DiyonaVas
 
Getting started with CSS frameworks using Zurb foundation
Melanie Archer
 
HTML and CSS part 3
Julie Iskander
 
cascading style sheet powerpoint notes.pptx
kcdiya58
 
960 grid psd
Raju Nag
 
Flexbox, Grid and Sass
Seble Nigussie
 
CSS3 PPT.pptx
AchieversIT
 
CSS3 Layout
Zoe Gillenwater
 
The Future of CSS Layout
Zoe Gillenwater
 
Advanced css for designing responsive web page on website
AbrahamChe2
 
Web I - 07 - CSS Frameworks
Randy Connolly
 
Cascading Style Sheets CSS
Asif Shahzad
 
CSS - OOCSS, SMACSS and more
Russ Weakley
 
Organize Your Website With Advanced CSS Tricks
Andolasoft Inc
 
IV - CSS architecture
WebF
 
CSS Basics
Nitin Bhide
 
Introduction to CSS3
Doris Chen
 
Castro Chapter 11
Jeff Byrnes
 
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
Deepak Sharma
 

More from Pushkar Sharma (7)

PPTX
Introduction to HTML: The Building Block of the Web by Infinite Web Solutions...
Pushkar Sharma
 
PPTX
Introduction to .NET: The Ultimate Development Framework by Infinite Web Solu...
Pushkar Sharma
 
PPTX
Getting Started with ReactJS: Build Dynamic UIs by Infinite Web Solutions.pptx
Pushkar Sharma
 
PPTX
Introduction to JavaScript: The Language of the Web by Infinite Web Solutions...
Pushkar Sharma
 
PPTX
Design Like a Pro: Getting Started with Figma by Infinite Web Solutions.pptx
Pushkar Sharma
 
PPTX
Introduction to C#: A Modern Programming Language by Infinite Web Solutions.pptx
Pushkar Sharma
 
PPTX
Mastering MySQL: The Heart of Database Management by Infinite Web Solutions.pptx
Pushkar Sharma
 
Introduction to HTML: The Building Block of the Web by Infinite Web Solutions...
Pushkar Sharma
 
Introduction to .NET: The Ultimate Development Framework by Infinite Web Solu...
Pushkar Sharma
 
Getting Started with ReactJS: Build Dynamic UIs by Infinite Web Solutions.pptx
Pushkar Sharma
 
Introduction to JavaScript: The Language of the Web by Infinite Web Solutions...
Pushkar Sharma
 
Design Like a Pro: Getting Started with Figma by Infinite Web Solutions.pptx
Pushkar Sharma
 
Introduction to C#: A Modern Programming Language by Infinite Web Solutions.pptx
Pushkar Sharma
 
Mastering MySQL: The Heart of Database Management by Infinite Web Solutions.pptx
Pushkar Sharma
 
Ad

Recently uploaded (20)

PPTX
2025 Winter SWAYAM NPTEL & A Student.pptx
Utsav Yagnik
 
PDF
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
PPTX
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
PPT
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
PDF
Zoology (Animal Physiology) practical Manual
raviralanaresh2
 
PPTX
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PPTX
Mathematics 5 - Time Measurement: Time Zone
menchreo
 
PDF
The Different Types of Non-Experimental Research
Thelma Villaflores
 
PPTX
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
PPSX
Health Planning in india - Unit 03 - CHN 2 - GNM 3RD YEAR.ppsx
Priyanshu Anand
 
PDF
Dimensions of Societal Planning in Commonism
StefanMz
 
PPTX
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
PDF
CHILD RIGHTS AND PROTECTION QUESTION BANK
Dr Raja Mohammed T
 
PDF
LAW OF CONTRACT (5 YEAR LLB & UNITARY LLB )- MODULE - 1.& 2 - LEARN THROUGH P...
APARNA T SHAIL KUMAR
 
PPTX
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
PDF
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
PPT
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
PPTX
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
PPTX
Soil and agriculture microbiology .pptx
Keerthana Ramesh
 
PPSX
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
2025 Winter SWAYAM NPTEL & A Student.pptx
Utsav Yagnik
 
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
Zoology (Animal Physiology) practical Manual
raviralanaresh2
 
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
Mathematics 5 - Time Measurement: Time Zone
menchreo
 
The Different Types of Non-Experimental Research
Thelma Villaflores
 
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
Health Planning in india - Unit 03 - CHN 2 - GNM 3RD YEAR.ppsx
Priyanshu Anand
 
Dimensions of Societal Planning in Commonism
StefanMz
 
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
CHILD RIGHTS AND PROTECTION QUESTION BANK
Dr Raja Mohammed T
 
LAW OF CONTRACT (5 YEAR LLB & UNITARY LLB )- MODULE - 1.& 2 - LEARN THROUGH P...
APARNA T SHAIL KUMAR
 
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
Soil and agriculture microbiology .pptx
Keerthana Ramesh
 
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
Ad

Mastering CSS: The Foundation of Web Design by Infinite Web Solutions.pptx