Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CSS3: Layouts for the Multi-screen World

Peter Gasston
November 28, 2012

CSS3: Layouts for the Multi-screen World

Talk given at Future of Web Design, Prague, 28 Nov 2012. #fowa #fowd

Peter Gasston

November 28, 2012
Tweet

More Decks by Peter Gasston

Other Decks in Programming

Transcript

  1. @media screen {} @media screen and (min-width: 800px) {} @media

    (orientation: portrait) {} Media Queries
  2. Flexbox A B .a { flex: 2; } .b {

    flex: 1; } A B .parent { flex-direction: column; } .a { flex: 2; } .b { flex: 1; }
  3. Flexbox .parent { align-items: center; justify-content: center; } .parent {

    flex-direction: column; } .a { order: 2; } .b { order: 1; } A B
  4. Grid Layout .parent { display: grid; grid-definition-columns: 1fr 1fr 2fr;

    } .parent { grid-definition-columns: 1fr 1fr 2fr; grid-definition-rows: 10em auto 40px; }
  5. Grid Layout A B .child { grid-column-position: 2; grid-row-position: 2;

    } .a { grid-column: 2 2; } .b { grid-row-span: 3; }
  6. Konec. * Some of the CSS properties shown in this

    talk are experimental and subject to change. Always check http://caniuse.com and http://html5please.com for latest implementation status.