SlideShare uma empresa Scribd logo
1 de 45
Baixar para ler offline
Introduction to CSS3
Doris Chen Ph.D.
Developer Evangelist
Microsoft
http://blogs.msdn.com/dorischen/
Agenda
 What is CSS3?
 Media Queries
 Advanced Layout
 Tools
 Summary and Resources
What’s is CSS3?
What is CSS used for now?
 Layout
 Colors
 Fonts and text
 Backgrounds
 Borders
 Floats
The Fundamentals

     Elements
     Attributes
     Selectors
     Properties




5
Why Should I Care?
 Key technology in the HTML5 family
 Benefits
    Improve response times
    Less reliance on JavaScript and plug-ins
    Less site maintenance
 Good Patterns
    Progressive enhancement
    Adaptive design
 A new audience for us
What is CSS3?
                           Last update: June 13, 2011




                                                    Geolocation
                                                      ECMA
HTML   CSS      Web Apps                   SVG




7
What is CSS3?
                          Defines visual appearance
                           of webpages
                          Divided into over 50
                           modules
                          Vendor prefixes used to
                           specify browser
                           extensions
                             -ms-
                             -moz-




                                                       Geolocation
                                                         ECMA
                             -webkit-
         HTML   CSS           Web Apps          SVG




PAGE 8
What’s New in CSS3?
            2D Transforms              3D Transforms
            Backgrounds & Borders      Animations
                                        Gradient
            Color
                                        CSS Exclusions (Floats)
            Values and Units           Flexible Box (“Flexbox”)
            Selectors                   Layout
            Web Fonts                  Grid Layout
            Media Queries              Multi-column Layout
                                        Region
            Namespaces                 SVG Filter Effects
                                        Text Shadow
                                        Transitions



PAGE 9
Media Queries
A look…




          11
Media Queries
 Examine device properties to determine optimal delivery
  and placement of content
 The CSS3 Media Queries Module specifies methods to
  enable web developers to scope a style sheet to a set of
  precise device capabilities.
 Adapt output based on media type
      The Desktop Browser, Screen, Print
      Mobile Browsers
      Tablet form-factors
      Televisions
      Game Consoles
Media Queries Samples
@media screen and (max-width: 600px) {
  body {
    font-size: 80%;
  }
}


@media screen and (min-width:320px) and
(max-width:480px)


@media not print and (max-width:600px)
Supported Media Properties

           min/max-width          color
           min/max-height         color-index
           device-width           monochrome
           device-height          resolution
           orientation
           aspect-ratio
           device-aspect-ratio


PAGE 14
http://mediaqueri.es




15
View States
device-
portrait

    /* Re-arrange and hide/show content */
                                                                Full screen          Portrait

                                                  full-screen
                                                  snapped
                                                  fill




                                                                              Snap
                                                                      Fill


           Blog http://blogs.msdn.com/dorischen
Media Queries: Portrait View
            Before                             After




19
     Space is used more efficiently after apply all css rules in Media Queries
Advanced Layout
Manage the wireframe
22
CSS 3 flexible box layout
• Define direction and     •   display: flexbox
  ordering of flexible     •   -ms-box-direction
  box items                •   -ms-box-orient
• Define how to            •   -ms-box-ordinal-
  distribute and share         group
  free space to flexibly   •   -ms-box-line-
  space and size               progression
  elements                 •   -ms-box-lines
• Align items              •   -ms-box-pack
  horizontally or          •   -ms-box-flex
  vertically               •   -ms-box-align
CSS 3 flexible box layout uses
 Build simple designs that partition
  space vertically or horizontally

 Align related elements and distribute
  available space

 Perfect for menus, lightweight
  collections, or simple designs
Grid Layout
 Organizes a webpage by dividing space into major
  regions
 Allows elements to align into columns and rows without
  the use of tables
 Enables a variety of layouts
    Span columns or rows
    Overlap
    Layer
 Adapts to changes due to
    Media
    Orientation
    Available space
CSS3 grid layout
 Create a grid and          display: grid
  define grid rows and       -ms-grid-columns
  columns                    -ms-grid-rows

 Place grid items within      -ms-grid-column
  the grid rows and            -ms-grid-row
  columns                      -ms-grid-column-span
 Define flexible row,         -ms-grid-row-span
  column sizing

 Align grid children        -ms-grid-column-align
                             -ms-grid-row-align
Grid Layout

1




2




3


27
28
CSS3 grid layout uses
 Enables you to easily design grid-aligned apps
  that partition space vertically and horizontally


 Uses declarative styles to create clean designs
  that can be easily adapted to multiple resolutions


 Allows you to specify positions independent of
  content order


 Perfect for more complex Metro style apps
Multi-Column Layout
 Layout content in multiple columns without the use of
  tables
 Content can flow from one column to another
 Columns are separated by a gap and rule
Multi-Column Layout




31
CSS3 multiple column layout
• Break text across   • column-count
  multiple columns    • column-width

• Specify column      • column-gap
  gaps
                      • column-rule-color
• Enable and style    • column-rule-style
  column rules        • column-rule-width
33
Thinking About Adaptability
 Manage Device Families
    CSS3 Media Queries
 Manage Real Estate
    CSS3 Grid Layout
 Adaptive Components
    CSS3 FlexBox
    CSS3 Multi-Column
CSS3
Tools
The development tools are FREE!
If you use a higher SKU, it just works!
Blend five ways: Visual Design Tool
Layout
     Visual sizing & re-
     parenting, CSS3 grids,
     element management
Styling
     Responsive design, rich
     value editors for CSS3
     properties
Debug HTML
     Live DOM, inspect both
     markup and live values
Debug CSS
     Cascade, computed values,
     “Winning Properties”
JavaScript
     Runs on the design
     surface – you are styling
     the live application.
 39
Summary
Summary
 Leverage CSS3 to design Windows 8 apps more
  easily
 Think about Responsive Web Design
    Manage Device Families
       Media Queries
    CSS3 Grid and CSS3 flexible box to design
     elegant and flexible apps
    Adaptive Components
       Positioned floats, CSS3 multiple columns,
        for beautiful text-centric designs
Resources
RESOURCES
    • Internet Explorer 10 Developer Guide for CSS
       • http://msdn.microsoft.com/en-
         us/library/ie/hh673536(v=vs.85).aspx
    • CSS3 For Windows 8 Demo
       • http://ie.microsoft.com/testdrive/Graphics/hands-
         on-css3/
    • Feature-specific demos
          • http://ie.microsoft.com/testdrive/
    • Real-world demos
          • http://www.beautyoftheweb.com/
    • IE Team Blogs
PAGE 43
          • http://blogs.msdn.com/b/ie/
          Blog http://blogs.msdn.com/dorischen
Windows 8 RTM Resources
 Windows 8 and Tools Download
    http://bit.ly/Wins8Download
 Windows 8 Cheat Sheet
    http://bit.ly/wins8cheatsheet
 Develop Windows 8 in 30 Days with Consulting&
  Support
    http://bit.ly/Win8GenApp
 Free Windows 8 training & Hackathon Events
    http://bit.ly/wins8Hackathon
 Windows 8 Dev Center
    http://dev.windows.com
IE Test Drive
 ietestdrive.com




PAGE 45

Mais conteúdo relacionado

Mais procurados

Bootstrap PPT by Mukesh
Bootstrap PPT by MukeshBootstrap PPT by Mukesh
Bootstrap PPT by MukeshMukesh Kumar
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSSMario Hernandez
 
Bootstrap 3
Bootstrap 3Bootstrap 3
Bootstrap 3Lanh Le
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to JavascriptAmit Tyagi
 
Complete Lecture on Css presentation
Complete Lecture on Css presentation Complete Lecture on Css presentation
Complete Lecture on Css presentation Salman Memon
 
Presentation of bootstrap
Presentation of bootstrapPresentation of bootstrap
Presentation of bootstrap1amitgupta
 
JavaScript Programming
JavaScript ProgrammingJavaScript Programming
JavaScript ProgrammingSehwan Noh
 
Html5 tutorial for beginners
Html5 tutorial for beginnersHtml5 tutorial for beginners
Html5 tutorial for beginnersSingsys Pte Ltd
 
How Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) WorksHow Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) WorksAmit Tyagi
 
CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout Rachel Andrew
 
Dom(document object model)
Dom(document object model)Dom(document object model)
Dom(document object model)Partnered Health
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSSAmit Tyagi
 

Mais procurados (20)

jQuery for beginners
jQuery for beginnersjQuery for beginners
jQuery for beginners
 
Bootstrap PPT by Mukesh
Bootstrap PPT by MukeshBootstrap PPT by Mukesh
Bootstrap PPT by Mukesh
 
Bootstrap
BootstrapBootstrap
Bootstrap
 
Advanced Cascading Style Sheets
Advanced Cascading Style SheetsAdvanced Cascading Style Sheets
Advanced Cascading Style Sheets
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
 
Flexbox
FlexboxFlexbox
Flexbox
 
Javascript basics
Javascript basicsJavascript basics
Javascript basics
 
Bootstrap 3
Bootstrap 3Bootstrap 3
Bootstrap 3
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
 
Complete Lecture on Css presentation
Complete Lecture on Css presentation Complete Lecture on Css presentation
Complete Lecture on Css presentation
 
Presentation of bootstrap
Presentation of bootstrapPresentation of bootstrap
Presentation of bootstrap
 
JavaScript Programming
JavaScript ProgrammingJavaScript Programming
JavaScript Programming
 
Html5 tutorial for beginners
Html5 tutorial for beginnersHtml5 tutorial for beginners
Html5 tutorial for beginners
 
How Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) WorksHow Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) Works
 
Css Ppt
Css PptCss Ppt
Css Ppt
 
Css ppt
Css pptCss ppt
Css ppt
 
CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout
 
Dom(document object model)
Dom(document object model)Dom(document object model)
Dom(document object model)
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
Basics of JavaScript
Basics of JavaScriptBasics of JavaScript
Basics of JavaScript
 

Destaque

Training HTML5 CSS3 Ilkom IPB
Training HTML5 CSS3 Ilkom IPBTraining HTML5 CSS3 Ilkom IPB
Training HTML5 CSS3 Ilkom IPBWahyu Putra
 
HTML/CSS Crash Course (april 4 2017)
HTML/CSS Crash Course (april 4 2017)HTML/CSS Crash Course (april 4 2017)
HTML/CSS Crash Course (april 4 2017)Daniel Friedman
 
Fleet & transport policy - Envision International (Conf 2010)
Fleet & transport policy - Envision International (Conf 2010)Fleet & transport policy - Envision International (Conf 2010)
Fleet & transport policy - Envision International (Conf 2010)Andre Knipe
 
HTML5, CSS3, and JavaScript
HTML5, CSS3, and JavaScriptHTML5, CSS3, and JavaScript
HTML5, CSS3, and JavaScriptZac Gordon
 
Basic Transport & Fleet Mngt - AK2015
Basic Transport & Fleet Mngt - AK2015Basic Transport & Fleet Mngt - AK2015
Basic Transport & Fleet Mngt - AK2015Andre Knipe
 
Vehicle Management Software
Vehicle Management SoftwareVehicle Management Software
Vehicle Management SoftwareTracey Billings
 
CSS3: A practical introduction (FT2010 talk)
CSS3: A practical introduction (FT2010 talk)CSS3: A practical introduction (FT2010 talk)
CSS3: A practical introduction (FT2010 talk)Lea Verou
 
Building a game with JavaScript (March 2017, washington dc)
Building a game with JavaScript (March 2017, washington dc)Building a game with JavaScript (March 2017, washington dc)
Building a game with JavaScript (March 2017, washington dc)Daniel Friedman
 
CSS Animations & Transitions
CSS Animations & TransitionsCSS Animations & Transitions
CSS Animations & TransitionsEdward Meehan
 
Modular HTML, CSS, & JS Workshop
Modular HTML, CSS, & JS WorkshopModular HTML, CSS, & JS Workshop
Modular HTML, CSS, & JS WorkshopShay Howe
 
CSS3 Transforms Transitions and Animations
CSS3 Transforms Transitions and AnimationsCSS3 Transforms Transitions and Animations
CSS3 Transforms Transitions and AnimationsInayaili León
 
Vehicle Information System
Vehicle Information SystemVehicle Information System
Vehicle Information SystemRajan Kandel
 

Destaque (20)

Fundamental CSS3
Fundamental CSS3Fundamental CSS3
Fundamental CSS3
 
Intro to CSS3
Intro to CSS3Intro to CSS3
Intro to CSS3
 
Introduction to HTML5 & CSS3
Introduction to HTML5 & CSS3Introduction to HTML5 & CSS3
Introduction to HTML5 & CSS3
 
CSS Part I
CSS Part ICSS Part I
CSS Part I
 
CSS Part II
CSS Part IICSS Part II
CSS Part II
 
Training HTML5 CSS3 Ilkom IPB
Training HTML5 CSS3 Ilkom IPBTraining HTML5 CSS3 Ilkom IPB
Training HTML5 CSS3 Ilkom IPB
 
HTML/CSS Crash Course (april 4 2017)
HTML/CSS Crash Course (april 4 2017)HTML/CSS Crash Course (april 4 2017)
HTML/CSS Crash Course (april 4 2017)
 
CSS3 Introduction
CSS3 IntroductionCSS3 Introduction
CSS3 Introduction
 
Fleet & transport policy - Envision International (Conf 2010)
Fleet & transport policy - Envision International (Conf 2010)Fleet & transport policy - Envision International (Conf 2010)
Fleet & transport policy - Envision International (Conf 2010)
 
HTML5, CSS3, and JavaScript
HTML5, CSS3, and JavaScriptHTML5, CSS3, and JavaScript
HTML5, CSS3, and JavaScript
 
Session and cookies ,get and post methods
Session and cookies ,get and post methodsSession and cookies ,get and post methods
Session and cookies ,get and post methods
 
Basic Transport & Fleet Mngt - AK2015
Basic Transport & Fleet Mngt - AK2015Basic Transport & Fleet Mngt - AK2015
Basic Transport & Fleet Mngt - AK2015
 
Vehicle Management Software
Vehicle Management SoftwareVehicle Management Software
Vehicle Management Software
 
CSS3: A practical introduction (FT2010 talk)
CSS3: A practical introduction (FT2010 talk)CSS3: A practical introduction (FT2010 talk)
CSS3: A practical introduction (FT2010 talk)
 
Building a game with JavaScript (March 2017, washington dc)
Building a game with JavaScript (March 2017, washington dc)Building a game with JavaScript (March 2017, washington dc)
Building a game with JavaScript (March 2017, washington dc)
 
Fleet management system
Fleet management systemFleet management system
Fleet management system
 
CSS Animations & Transitions
CSS Animations & TransitionsCSS Animations & Transitions
CSS Animations & Transitions
 
Modular HTML, CSS, & JS Workshop
Modular HTML, CSS, & JS WorkshopModular HTML, CSS, & JS Workshop
Modular HTML, CSS, & JS Workshop
 
CSS3 Transforms Transitions and Animations
CSS3 Transforms Transitions and AnimationsCSS3 Transforms Transitions and Animations
CSS3 Transforms Transitions and Animations
 
Vehicle Information System
Vehicle Information SystemVehicle Information System
Vehicle Information System
 

Semelhante a CSS3 Introduction: Layouts, Media Queries and More

CSS3: Simply Responsive
CSS3: Simply ResponsiveCSS3: Simply Responsive
CSS3: Simply ResponsiveDenise Jacobs
 
Digibury: Getting your web presence mobile ready - David Walker
Digibury: Getting your web presence mobile ready - David WalkerDigibury: Getting your web presence mobile ready - David Walker
Digibury: Getting your web presence mobile ready - David WalkerLizzie Hodgson
 
Website trends 2012 presentation
Website trends 2012 presentationWebsite trends 2012 presentation
Website trends 2012 presentationFresh_Egg
 
CSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to RespondCSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to RespondDenise Jacobs
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web DesignJason Harwig
 
Organize Your Website With Advanced CSS Tricks
Organize Your Website With Advanced CSS TricksOrganize Your Website With Advanced CSS Tricks
Organize Your Website With Advanced CSS TricksAndolasoft Inc
 
Media queries and frameworks
Media queries and frameworksMedia queries and frameworks
Media queries and frameworksNicole Ryan
 
Responsive Web Design & APEX Theme 25 (OGh APEX World 2014)
Responsive Web Design & APEX Theme 25 (OGh APEX World 2014)Responsive Web Design & APEX Theme 25 (OGh APEX World 2014)
Responsive Web Design & APEX Theme 25 (OGh APEX World 2014)Christian Rokitta
 
Developing for Responsive Design - Frederic Welterlin
Developing for Responsive Design - Frederic WelterlinDeveloping for Responsive Design - Frederic Welterlin
Developing for Responsive Design - Frederic WelterlinRazorfish
 
A Complete Guide to Frontend - UI Developer
A Complete Guide to Frontend - UI DeveloperA Complete Guide to Frontend - UI Developer
A Complete Guide to Frontend - UI Developernariyaravi
 
CSS Training Online-Online CSS Course css course online learning html and css...
CSS Training Online-Online CSS Course css course online learning html and css...CSS Training Online-Online CSS Course css course online learning html and css...
CSS Training Online-Online CSS Course css course online learning html and css...Evanta Technologies
 
Responsive Web Designed for your communication and marketing needs
Responsive Web Designed for your communication and marketing needsResponsive Web Designed for your communication and marketing needs
Responsive Web Designed for your communication and marketing needsSEGIC
 
Responsive Web Design & APEX Theme 25
Responsive Web Design & APEX Theme 25Responsive Web Design & APEX Theme 25
Responsive Web Design & APEX Theme 25Christian Rokitta
 
The Modern Web, Part 2: HTML5
The Modern Web, Part 2: HTML5The Modern Web, Part 2: HTML5
The Modern Web, Part 2: HTML5David Pallmann
 
CSS vs. JavaScript - Trust vs. Control
CSS vs. JavaScript - Trust vs. ControlCSS vs. JavaScript - Trust vs. Control
CSS vs. JavaScript - Trust vs. ControlChristian Heilmann
 
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin..."Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...Yandex
 
Chapter 17: Responsive Web Design
Chapter 17: Responsive Web DesignChapter 17: Responsive Web Design
Chapter 17: Responsive Web DesignSteve Guinan
 

Semelhante a CSS3 Introduction: Layouts, Media Queries and More (20)

Media queries
Media queriesMedia queries
Media queries
 
CSS3: Simply Responsive
CSS3: Simply ResponsiveCSS3: Simply Responsive
CSS3: Simply Responsive
 
Digibury: Getting your web presence mobile ready - David Walker
Digibury: Getting your web presence mobile ready - David WalkerDigibury: Getting your web presence mobile ready - David Walker
Digibury: Getting your web presence mobile ready - David Walker
 
Website trends 2012 presentation
Website trends 2012 presentationWebsite trends 2012 presentation
Website trends 2012 presentation
 
CSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to RespondCSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to Respond
 
Approaches to Responsive Wen Design & Development
Approaches to Responsive Wen Design & DevelopmentApproaches to Responsive Wen Design & Development
Approaches to Responsive Wen Design & Development
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web Design
 
Organize Your Website With Advanced CSS Tricks
Organize Your Website With Advanced CSS TricksOrganize Your Website With Advanced CSS Tricks
Organize Your Website With Advanced CSS Tricks
 
Media queries and frameworks
Media queries and frameworksMedia queries and frameworks
Media queries and frameworks
 
Responsive Web Design & APEX Theme 25 (OGh APEX World 2014)
Responsive Web Design & APEX Theme 25 (OGh APEX World 2014)Responsive Web Design & APEX Theme 25 (OGh APEX World 2014)
Responsive Web Design & APEX Theme 25 (OGh APEX World 2014)
 
Developing for Responsive Design - Frederic Welterlin
Developing for Responsive Design - Frederic WelterlinDeveloping for Responsive Design - Frederic Welterlin
Developing for Responsive Design - Frederic Welterlin
 
A Complete Guide to Frontend - UI Developer
A Complete Guide to Frontend - UI DeveloperA Complete Guide to Frontend - UI Developer
A Complete Guide to Frontend - UI Developer
 
CSS Training Online-Online CSS Course css course online learning html and css...
CSS Training Online-Online CSS Course css course online learning html and css...CSS Training Online-Online CSS Course css course online learning html and css...
CSS Training Online-Online CSS Course css course online learning html and css...
 
Introduction to HTML5 and CSS3
Introduction to HTML5 and CSS3Introduction to HTML5 and CSS3
Introduction to HTML5 and CSS3
 
Responsive Web Designed for your communication and marketing needs
Responsive Web Designed for your communication and marketing needsResponsive Web Designed for your communication and marketing needs
Responsive Web Designed for your communication and marketing needs
 
Responsive Web Design & APEX Theme 25
Responsive Web Design & APEX Theme 25Responsive Web Design & APEX Theme 25
Responsive Web Design & APEX Theme 25
 
The Modern Web, Part 2: HTML5
The Modern Web, Part 2: HTML5The Modern Web, Part 2: HTML5
The Modern Web, Part 2: HTML5
 
CSS vs. JavaScript - Trust vs. Control
CSS vs. JavaScript - Trust vs. ControlCSS vs. JavaScript - Trust vs. Control
CSS vs. JavaScript - Trust vs. Control
 
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin..."Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
 
Chapter 17: Responsive Web Design
Chapter 17: Responsive Web DesignChapter 17: Responsive Web Design
Chapter 17: Responsive Web Design
 

Mais de Doris Chen

Practical tipsmakemobilefaster oscon2016
Practical tipsmakemobilefaster oscon2016Practical tipsmakemobilefaster oscon2016
Practical tipsmakemobilefaster oscon2016Doris Chen
 
Building Web Sites that Work Everywhere
Building Web Sites that Work EverywhereBuilding Web Sites that Work Everywhere
Building Web Sites that Work EverywhereDoris Chen
 
Angular mobile angular_u
Angular mobile angular_uAngular mobile angular_u
Angular mobile angular_uDoris Chen
 
Lastest Trends in Web Development
Lastest Trends in Web DevelopmentLastest Trends in Web Development
Lastest Trends in Web DevelopmentDoris Chen
 
Angular or Backbone: Go Mobile!
Angular or Backbone: Go Mobile!Angular or Backbone: Go Mobile!
Angular or Backbone: Go Mobile!Doris Chen
 
OSCON Presentation: Developing High Performance Websites and Modern Apps with...
OSCON Presentation: Developing High Performance Websites and Modern Apps with...OSCON Presentation: Developing High Performance Websites and Modern Apps with...
OSCON Presentation: Developing High Performance Websites and Modern Apps with...Doris Chen
 
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps FasterPractical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps FasterDoris Chen
 
Developing High Performance Websites and Modern Apps with JavaScript and HTML5
Developing High Performance Websites and Modern Apps with JavaScript and HTML5Developing High Performance Websites and Modern Apps with JavaScript and HTML5
Developing High Performance Websites and Modern Apps with JavaScript and HTML5Doris Chen
 
What Web Developers Need to Know to Develop Native HTML5/JS Apps
What Web Developers Need to Know to Develop Native HTML5/JS AppsWhat Web Developers Need to Know to Develop Native HTML5/JS Apps
What Web Developers Need to Know to Develop Native HTML5/JS AppsDoris Chen
 
Windows 8 Opportunity
Windows 8 OpportunityWindows 8 Opportunity
Windows 8 OpportunityDoris Chen
 
Wins8 appfoforweb fluent
Wins8 appfoforweb fluentWins8 appfoforweb fluent
Wins8 appfoforweb fluentDoris Chen
 
Develop High Performance Windows 8 Application with HTML5 and JavaScriptHigh ...
Develop High Performance Windows 8 Application with HTML5 and JavaScriptHigh ...Develop High Performance Windows 8 Application with HTML5 and JavaScriptHigh ...
Develop High Performance Windows 8 Application with HTML5 and JavaScriptHigh ...Doris Chen
 
What Web Developers Need to Know to Develop Windows 8 Apps
What Web Developers Need to Know to Develop Windows 8 AppsWhat Web Developers Need to Know to Develop Windows 8 Apps
What Web Developers Need to Know to Develop Windows 8 AppsDoris Chen
 
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3Doris Chen
 
Building Beautiful and Interactive Windows 8 apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Windows 8 apps with JavaScript, HTML5 & CSS3Building Beautiful and Interactive Windows 8 apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Windows 8 apps with JavaScript, HTML5 & CSS3Doris Chen
 
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3Doris Chen
 
Practical HTML5: Using It Today
Practical HTML5: Using It TodayPractical HTML5: Using It Today
Practical HTML5: Using It TodayDoris Chen
 
Dive Into HTML5
Dive Into HTML5Dive Into HTML5
Dive Into HTML5Doris Chen
 
Practical HTML5: Using It Today
Practical HTML5: Using It TodayPractical HTML5: Using It Today
Practical HTML5: Using It TodayDoris Chen
 
HTML 5 Development for Windows Phone and Desktop
HTML 5 Development for Windows Phone and DesktopHTML 5 Development for Windows Phone and Desktop
HTML 5 Development for Windows Phone and DesktopDoris Chen
 

Mais de Doris Chen (20)

Practical tipsmakemobilefaster oscon2016
Practical tipsmakemobilefaster oscon2016Practical tipsmakemobilefaster oscon2016
Practical tipsmakemobilefaster oscon2016
 
Building Web Sites that Work Everywhere
Building Web Sites that Work EverywhereBuilding Web Sites that Work Everywhere
Building Web Sites that Work Everywhere
 
Angular mobile angular_u
Angular mobile angular_uAngular mobile angular_u
Angular mobile angular_u
 
Lastest Trends in Web Development
Lastest Trends in Web DevelopmentLastest Trends in Web Development
Lastest Trends in Web Development
 
Angular or Backbone: Go Mobile!
Angular or Backbone: Go Mobile!Angular or Backbone: Go Mobile!
Angular or Backbone: Go Mobile!
 
OSCON Presentation: Developing High Performance Websites and Modern Apps with...
OSCON Presentation: Developing High Performance Websites and Modern Apps with...OSCON Presentation: Developing High Performance Websites and Modern Apps with...
OSCON Presentation: Developing High Performance Websites and Modern Apps with...
 
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps FasterPractical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
 
Developing High Performance Websites and Modern Apps with JavaScript and HTML5
Developing High Performance Websites and Modern Apps with JavaScript and HTML5Developing High Performance Websites and Modern Apps with JavaScript and HTML5
Developing High Performance Websites and Modern Apps with JavaScript and HTML5
 
What Web Developers Need to Know to Develop Native HTML5/JS Apps
What Web Developers Need to Know to Develop Native HTML5/JS AppsWhat Web Developers Need to Know to Develop Native HTML5/JS Apps
What Web Developers Need to Know to Develop Native HTML5/JS Apps
 
Windows 8 Opportunity
Windows 8 OpportunityWindows 8 Opportunity
Windows 8 Opportunity
 
Wins8 appfoforweb fluent
Wins8 appfoforweb fluentWins8 appfoforweb fluent
Wins8 appfoforweb fluent
 
Develop High Performance Windows 8 Application with HTML5 and JavaScriptHigh ...
Develop High Performance Windows 8 Application with HTML5 and JavaScriptHigh ...Develop High Performance Windows 8 Application with HTML5 and JavaScriptHigh ...
Develop High Performance Windows 8 Application with HTML5 and JavaScriptHigh ...
 
What Web Developers Need to Know to Develop Windows 8 Apps
What Web Developers Need to Know to Develop Windows 8 AppsWhat Web Developers Need to Know to Develop Windows 8 Apps
What Web Developers Need to Know to Develop Windows 8 Apps
 
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
 
Building Beautiful and Interactive Windows 8 apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Windows 8 apps with JavaScript, HTML5 & CSS3Building Beautiful and Interactive Windows 8 apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Windows 8 apps with JavaScript, HTML5 & CSS3
 
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
 
Practical HTML5: Using It Today
Practical HTML5: Using It TodayPractical HTML5: Using It Today
Practical HTML5: Using It Today
 
Dive Into HTML5
Dive Into HTML5Dive Into HTML5
Dive Into HTML5
 
Practical HTML5: Using It Today
Practical HTML5: Using It TodayPractical HTML5: Using It Today
Practical HTML5: Using It Today
 
HTML 5 Development for Windows Phone and Desktop
HTML 5 Development for Windows Phone and DesktopHTML 5 Development for Windows Phone and Desktop
HTML 5 Development for Windows Phone and Desktop
 

CSS3 Introduction: Layouts, Media Queries and More

  • 1. Introduction to CSS3 Doris Chen Ph.D. Developer Evangelist Microsoft http://blogs.msdn.com/dorischen/
  • 2. Agenda  What is CSS3?  Media Queries  Advanced Layout  Tools  Summary and Resources
  • 4. What is CSS used for now?  Layout  Colors  Fonts and text  Backgrounds  Borders  Floats
  • 5. The Fundamentals  Elements  Attributes  Selectors  Properties 5
  • 6. Why Should I Care?  Key technology in the HTML5 family  Benefits  Improve response times  Less reliance on JavaScript and plug-ins  Less site maintenance  Good Patterns  Progressive enhancement  Adaptive design  A new audience for us
  • 7. What is CSS3? Last update: June 13, 2011 Geolocation ECMA HTML CSS Web Apps SVG 7
  • 8. What is CSS3?  Defines visual appearance of webpages  Divided into over 50 modules  Vendor prefixes used to specify browser extensions  -ms-  -moz- Geolocation ECMA  -webkit- HTML CSS Web Apps SVG PAGE 8
  • 9. What’s New in CSS3?  2D Transforms  3D Transforms  Backgrounds & Borders  Animations  Gradient  Color  CSS Exclusions (Floats)  Values and Units  Flexible Box (“Flexbox”)  Selectors Layout  Web Fonts  Grid Layout  Media Queries  Multi-column Layout  Region  Namespaces  SVG Filter Effects  Text Shadow  Transitions PAGE 9
  • 11. A look… 11
  • 12. Media Queries  Examine device properties to determine optimal delivery and placement of content  The CSS3 Media Queries Module specifies methods to enable web developers to scope a style sheet to a set of precise device capabilities.  Adapt output based on media type  The Desktop Browser, Screen, Print  Mobile Browsers  Tablet form-factors  Televisions  Game Consoles
  • 13. Media Queries Samples @media screen and (max-width: 600px) { body { font-size: 80%; } } @media screen and (min-width:320px) and (max-width:480px) @media not print and (max-width:600px)
  • 14. Supported Media Properties  min/max-width  color  min/max-height  color-index  device-width  monochrome  device-height  resolution  orientation  aspect-ratio  device-aspect-ratio PAGE 14
  • 17.
  • 18. device- portrait /* Re-arrange and hide/show content */ Full screen Portrait full-screen snapped fill Snap Fill Blog http://blogs.msdn.com/dorischen
  • 19. Media Queries: Portrait View Before After 19 Space is used more efficiently after apply all css rules in Media Queries
  • 22. 22
  • 23. CSS 3 flexible box layout • Define direction and • display: flexbox ordering of flexible • -ms-box-direction box items • -ms-box-orient • Define how to • -ms-box-ordinal- distribute and share group free space to flexibly • -ms-box-line- space and size progression elements • -ms-box-lines • Align items • -ms-box-pack horizontally or • -ms-box-flex vertically • -ms-box-align
  • 24. CSS 3 flexible box layout uses  Build simple designs that partition space vertically or horizontally  Align related elements and distribute available space  Perfect for menus, lightweight collections, or simple designs
  • 25. Grid Layout  Organizes a webpage by dividing space into major regions  Allows elements to align into columns and rows without the use of tables  Enables a variety of layouts  Span columns or rows  Overlap  Layer  Adapts to changes due to  Media  Orientation  Available space
  • 26. CSS3 grid layout  Create a grid and  display: grid define grid rows and  -ms-grid-columns columns  -ms-grid-rows  Place grid items within  -ms-grid-column the grid rows and  -ms-grid-row columns  -ms-grid-column-span  Define flexible row,  -ms-grid-row-span column sizing  Align grid children  -ms-grid-column-align  -ms-grid-row-align
  • 28. 28
  • 29. CSS3 grid layout uses  Enables you to easily design grid-aligned apps that partition space vertically and horizontally  Uses declarative styles to create clean designs that can be easily adapted to multiple resolutions  Allows you to specify positions independent of content order  Perfect for more complex Metro style apps
  • 30. Multi-Column Layout  Layout content in multiple columns without the use of tables  Content can flow from one column to another  Columns are separated by a gap and rule
  • 32. CSS3 multiple column layout • Break text across • column-count multiple columns • column-width • Specify column • column-gap gaps • column-rule-color • Enable and style • column-rule-style column rules • column-rule-width
  • 33. 33
  • 34. Thinking About Adaptability  Manage Device Families  CSS3 Media Queries  Manage Real Estate  CSS3 Grid Layout  Adaptive Components  CSS3 FlexBox  CSS3 Multi-Column
  • 35. CSS3
  • 36. Tools
  • 37.
  • 38. The development tools are FREE! If you use a higher SKU, it just works!
  • 39. Blend five ways: Visual Design Tool Layout Visual sizing & re- parenting, CSS3 grids, element management Styling Responsive design, rich value editors for CSS3 properties Debug HTML Live DOM, inspect both markup and live values Debug CSS Cascade, computed values, “Winning Properties” JavaScript Runs on the design surface – you are styling the live application. 39
  • 41. Summary  Leverage CSS3 to design Windows 8 apps more easily  Think about Responsive Web Design  Manage Device Families  Media Queries  CSS3 Grid and CSS3 flexible box to design elegant and flexible apps  Adaptive Components  Positioned floats, CSS3 multiple columns, for beautiful text-centric designs
  • 43. RESOURCES • Internet Explorer 10 Developer Guide for CSS • http://msdn.microsoft.com/en- us/library/ie/hh673536(v=vs.85).aspx • CSS3 For Windows 8 Demo • http://ie.microsoft.com/testdrive/Graphics/hands- on-css3/ • Feature-specific demos • http://ie.microsoft.com/testdrive/ • Real-world demos • http://www.beautyoftheweb.com/ • IE Team Blogs PAGE 43 • http://blogs.msdn.com/b/ie/ Blog http://blogs.msdn.com/dorischen
  • 44. Windows 8 RTM Resources  Windows 8 and Tools Download  http://bit.ly/Wins8Download  Windows 8 Cheat Sheet  http://bit.ly/wins8cheatsheet  Develop Windows 8 in 30 Days with Consulting& Support  http://bit.ly/Win8GenApp  Free Windows 8 training & Hackathon Events  http://bit.ly/wins8Hackathon  Windows 8 Dev Center  http://dev.windows.com
  • 45. IE Test Drive ietestdrive.com PAGE 45