SlideShare a Scribd company logo
Advanced CSS:
Media Queries, and Frameworks
Chapter 5, Part 3
Objectives
Responsive
Design6
7 CSS Frameworks
Responsive Design
In a responsive design, the page “responds” to
changes in the browser size that go beyond the width
scaling of a liquid layout.
One of the problems of a liquid layout is that images
and horizontal navigation elements tend to take up a
fixed size, and when the browser window shrinks to
the size of a mobile browser, liquid layouts can
become unusable. In a responsive layout, images will
be scaled down and navigation elements will be
replaced as the browser shrinks,
Responsive DesignExample
Responsive DesignExample
There are four key components that make responsive
design work.
1. Liquid layouts
2. Scaling images to the viewport size
3. Setting viewports via the <meta> tag
4. Customizing the CSS for different viewports using
media queries
Responsive Design
Responsive designs begin with a liquid layout, that is,
one in which most elements have their widths
specified as percentages. Making images scale in size is
actually quite straightforward, in that you simply need
to specify the following rule:
img {
max-width: 100%;
}
Liquid Layout
Responsive Design
A key technique in
creating responsive
layouts makes use of the
ability of current mobile
browsers to shrink or
grow the web page to fit
the width of the screen.
Setting Viewports
Responsive Design
If the developer has created a responsive site that will scale to
fit a smaller screen, she may not want the mobile browser to
render it on the full-size viewport. The web page can tell the
mobile browser the viewport size to use via the viewport
<meta> element
<html>
<head>
<meta name="viewport" content="width=device-width" />
Setting Viewports
Responsive DesignSetting Viewports
Media Queries
The other key component of responsive designs is CSS
media queries. A media query is a way to apply style
rules based on the medium that is displaying the file.
You can use these queries to look at the capabilities of
the device, and then define CSS rules to target that
device.
Media Queries
Contemporary responsive sites will typically provide
CSS rules for phone displays first, then tablets, then
desktop monitors, an approach called progressive
enhancement, in which a design is adapted to
progressively more advanced devices
Media QueriesBrowser features you can Examine with Media Queries
Feature Description
width Width of the viewport
height Height of the viewport
device-width Width of the device
device-height Height of the device
orientation Whether the device is portrait or landscape
color The number of bits per color
[HP1]Au: Should these go in monospace font? HP
Media QueriesMedia queries in action
CSS Frameworks
A CSS framework is a precreated set of CSS classes or
other software tools that make it easier to use and
work with CSS.
They are two main types of CSS framework:
• Grid systems
• CSS preprocessors.
This is hard!
Grid Systems
Grid systems make it easier to create multicolumn
layouts. Some of the most popular are
• Bootstrap (twitter.github.com/bootstrap)
• Blueprint (www.blueprintcss.org)
• 960 (960.gs)
Print designers typically use grids as a way to achieve
visual uniformity in a design. In print design, the very
first thing a designer may do is to construct, for
instance, a 5- or 7- or 12-column grid. The rest of the
document, whether it be text or graphics, will be
aligned and sized according to the grid
Frameworks do the heavy lifting
Grid SystemsFrameworks do the heavy lifting
Grid Systems960 code
Grid SystemsBootstrap code
Example Pure Bootstrap Layouts
CSS Preprocessors
CSS preprocessors are tools that allow the developer
to write CSS that takes advantage of programming
ideas such as variables, inheritance, calculations, and
functions.
Most sites make use of some type of color scheme,
perhaps four or five colors. Many items will have the
same color.
CSS Preprocessors
What you Learned
Responsive
Design6
7
7 CSS Frameworks

More Related Content

PPTX
Presentation of bootstrap
PPTX
Media queries A to Z
PDF
CSS3: Using media queries to improve the web site experience
PDF
CSS3 Media Queries
PDF
CSS3, Media Queries, and Responsive Design
PPTX
Bootstrap for Beginners
PPTX
Bootstrap Framework
PDF
CSS3 Media Queries
Presentation of bootstrap
Media queries A to Z
CSS3: Using media queries to improve the web site experience
CSS3 Media Queries
CSS3, Media Queries, and Responsive Design
Bootstrap for Beginners
Bootstrap Framework
CSS3 Media Queries

What's hot (20)

PPT
Responsive Web Design
PPTX
Bootstrap ppt
PPTX
Responsive web designing ppt(1)
PDF
Responsive Web Design with HTML5 and CSS3
PDF
Slides bootstrap-4
PDF
Bootstrap 3 + responsive
PPT
Css best practices style guide and tips
PPTX
Bootstrap how it can help you build better websites
PPTX
Bootstrap 5 ppt
PPTX
Responsive Web Design
PDF
Front End Best Practices
PDF
Intro to CSS3
PDF
CSS Best practice
PPT
Making Your Own CSS Framework
PDF
Responsive Web Design
PDF
Designing an Enterprise CSS Framework is Hard, Stephanie Rewis
PPTX
Presentation about html5 css3
PDF
OOCSS, SMACSS or BEM?
PDF
Three quick accessibility tips for HTML5
PDF
Adobe MAX 2008: HTML/CSS + Fireworks
Responsive Web Design
Bootstrap ppt
Responsive web designing ppt(1)
Responsive Web Design with HTML5 and CSS3
Slides bootstrap-4
Bootstrap 3 + responsive
Css best practices style guide and tips
Bootstrap how it can help you build better websites
Bootstrap 5 ppt
Responsive Web Design
Front End Best Practices
Intro to CSS3
CSS Best practice
Making Your Own CSS Framework
Responsive Web Design
Designing an Enterprise CSS Framework is Hard, Stephanie Rewis
Presentation about html5 css3
OOCSS, SMACSS or BEM?
Three quick accessibility tips for HTML5
Adobe MAX 2008: HTML/CSS + Fireworks
Ad

Viewers also liked (8)

PPTX
Mobile Email Design, Strategies, Workflow and Best Practices
PDF
AngularJS best-practices
PDF
AngularJS Best Practices
PDF
New Features in Angular 1.5
PDF
The Art of AngularJS in 2015
PPTX
AngularJS best practices
PDF
Beyond Media Queries: Anatomy of an Adaptive Web Design
PPTX
AngularJS Best Practices
Mobile Email Design, Strategies, Workflow and Best Practices
AngularJS best-practices
AngularJS Best Practices
New Features in Angular 1.5
The Art of AngularJS in 2015
AngularJS best practices
Beyond Media Queries: Anatomy of an Adaptive Web Design
AngularJS Best Practices
Ad

Similar to Media queries and frameworks (20)

PPTX
Responsive web designing
PPTX
Responsive Web Designing Fundamentals
PPTX
Lecture20-Responsive Design.pptx
PPTX
Chapter 17: Responsive Web Design
PDF
Going responsive
PPTX
Responsive Web Designing for web development
PPTX
Responsive Web Design
PDF
Responsive Design Tools & Resources
PDF
Responsive Web Design
PDF
Responsive Web design Zambig
PDF
(Practical) Beyond Responsive Web Design (WordCamp Miami 2011)
PDF
Adapt and respond - mobile-friendly layouts beyond the desktop - standards>ne...
PDF
Great Responsive-ability Web Design
PDF
HTML5, CSS3 & Responsive Design
PDF
CSS3 Media Queries: Mobile Elixir or CSS Snake Oil
PPTX
Content authoring for responsive design
PPTX
Responsive web design
PDF
Responsive Web Design
PDF
Adaptive layouts - standards>next Manchester 23.03.2011
PPTX
Rwd ppt
Responsive web designing
Responsive Web Designing Fundamentals
Lecture20-Responsive Design.pptx
Chapter 17: Responsive Web Design
Going responsive
Responsive Web Designing for web development
Responsive Web Design
Responsive Design Tools & Resources
Responsive Web Design
Responsive Web design Zambig
(Practical) Beyond Responsive Web Design (WordCamp Miami 2011)
Adapt and respond - mobile-friendly layouts beyond the desktop - standards>ne...
Great Responsive-ability Web Design
HTML5, CSS3 & Responsive Design
CSS3 Media Queries: Mobile Elixir or CSS Snake Oil
Content authoring for responsive design
Responsive web design
Responsive Web Design
Adaptive layouts - standards>next Manchester 23.03.2011
Rwd ppt

More from Nicole Ryan (20)

PPT
Testing and Improving Performance
PPT
Optimizing a website for search engines
PPT
Inheritance
PPT
Javascript programming using the document object model
PPT
Working with Video and Audio
PPT
Working with Images
PPT
Python Dictionaries and Sets
PPT
Creating Visual Effects and Animation
PPT
Creating and Processing Web Forms
PPT
Organizing Content with Lists and Tables
PPT
Social media and your website
PPT
Working with Links
PPT
Formatting text with CSS
PPT
Laying Out Elements with CSS
PPT
Getting Started with CSS
PPT
Structure Web Content
PPT
Getting Started with your Website
PPTX
Chapter 12 Lecture: GUI Programming, Multithreading, and Animation
PPTX
Chapter 11: Object Oriented Programming Part 2
PPTX
Intro to Programming: Modularity
Testing and Improving Performance
Optimizing a website for search engines
Inheritance
Javascript programming using the document object model
Working with Video and Audio
Working with Images
Python Dictionaries and Sets
Creating Visual Effects and Animation
Creating and Processing Web Forms
Organizing Content with Lists and Tables
Social media and your website
Working with Links
Formatting text with CSS
Laying Out Elements with CSS
Getting Started with CSS
Structure Web Content
Getting Started with your Website
Chapter 12 Lecture: GUI Programming, Multithreading, and Animation
Chapter 11: Object Oriented Programming Part 2
Intro to Programming: Modularity

Recently uploaded (20)

PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
Pharma ospi slides which help in ospi learning
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
Classroom Observation Tools for Teachers
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Pre independence Education in Inndia.pdf
PPTX
Institutional Correction lecture only . . .
PDF
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
PPTX
Cell Structure & Organelles in detailed.
PDF
Complications of Minimal Access Surgery at WLH
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PPTX
master seminar digital applications in india
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
O5-L3 Freight Transport Ops (International) V1.pdf
Abdominal Access Techniques with Prof. Dr. R K Mishra
Microbial diseases, their pathogenesis and prophylaxis
Pharma ospi slides which help in ospi learning
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Classroom Observation Tools for Teachers
Module 4: Burden of Disease Tutorial Slides S2 2025
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Pre independence Education in Inndia.pdf
Institutional Correction lecture only . . .
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
Cell Structure & Organelles in detailed.
Complications of Minimal Access Surgery at WLH
Supply Chain Operations Speaking Notes -ICLT Program
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Week 4 Term 3 Study Techniques revisited.pptx
master seminar digital applications in india

Media queries and frameworks

  • 1. Advanced CSS: Media Queries, and Frameworks Chapter 5, Part 3
  • 3. Responsive Design In a responsive design, the page “responds” to changes in the browser size that go beyond the width scaling of a liquid layout. One of the problems of a liquid layout is that images and horizontal navigation elements tend to take up a fixed size, and when the browser window shrinks to the size of a mobile browser, liquid layouts can become unusable. In a responsive layout, images will be scaled down and navigation elements will be replaced as the browser shrinks,
  • 5. Responsive DesignExample There are four key components that make responsive design work. 1. Liquid layouts 2. Scaling images to the viewport size 3. Setting viewports via the <meta> tag 4. Customizing the CSS for different viewports using media queries
  • 6. Responsive Design Responsive designs begin with a liquid layout, that is, one in which most elements have their widths specified as percentages. Making images scale in size is actually quite straightforward, in that you simply need to specify the following rule: img { max-width: 100%; } Liquid Layout
  • 7. Responsive Design A key technique in creating responsive layouts makes use of the ability of current mobile browsers to shrink or grow the web page to fit the width of the screen. Setting Viewports
  • 8. Responsive Design If the developer has created a responsive site that will scale to fit a smaller screen, she may not want the mobile browser to render it on the full-size viewport. The web page can tell the mobile browser the viewport size to use via the viewport <meta> element <html> <head> <meta name="viewport" content="width=device-width" /> Setting Viewports
  • 10. Media Queries The other key component of responsive designs is CSS media queries. A media query is a way to apply style rules based on the medium that is displaying the file. You can use these queries to look at the capabilities of the device, and then define CSS rules to target that device.
  • 11. Media Queries Contemporary responsive sites will typically provide CSS rules for phone displays first, then tablets, then desktop monitors, an approach called progressive enhancement, in which a design is adapted to progressively more advanced devices
  • 12. Media QueriesBrowser features you can Examine with Media Queries Feature Description width Width of the viewport height Height of the viewport device-width Width of the device device-height Height of the device orientation Whether the device is portrait or landscape color The number of bits per color [HP1]Au: Should these go in monospace font? HP
  • 14. CSS Frameworks A CSS framework is a precreated set of CSS classes or other software tools that make it easier to use and work with CSS. They are two main types of CSS framework: • Grid systems • CSS preprocessors. This is hard!
  • 15. Grid Systems Grid systems make it easier to create multicolumn layouts. Some of the most popular are • Bootstrap (twitter.github.com/bootstrap) • Blueprint (www.blueprintcss.org) • 960 (960.gs) Print designers typically use grids as a way to achieve visual uniformity in a design. In print design, the very first thing a designer may do is to construct, for instance, a 5- or 7- or 12-column grid. The rest of the document, whether it be text or graphics, will be aligned and sized according to the grid Frameworks do the heavy lifting
  • 16. Grid SystemsFrameworks do the heavy lifting
  • 20. CSS Preprocessors CSS preprocessors are tools that allow the developer to write CSS that takes advantage of programming ideas such as variables, inheritance, calculations, and functions. Most sites make use of some type of color scheme, perhaps four or five colors. Many items will have the same color.