Successfully reported this slideshow.
Your SlideShare is downloading. ×

Layout with flexbox

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad

Check these out next

1 of 57 Ad

More Related Content

Viewers also liked (18)

Advertisement

Similar to Layout with flexbox (20)

Recently uploaded (20)

Advertisement

Layout with flexbox

  1. 1. Flexbox Layouts A proper layout tool for the web… Finally!
  2. 2. HTML layouts before display
  3. 3. HTML layouts before display block | inline | inline-block | table | inline-table
  4. 4. HTML layouts before position
  5. 5. HTML layouts before position relative | absolute | fixed | static
  6. 6. HTML layouts before float
  7. 7. HTML layouts before float left | right | none
  8. 8. HTML layouts before float left | right | none clear
  9. 9. HTML layouts before float left | right | none clear left | right | both | none
  10. 10. HTML layouts with Flexbox
  11. 11. HTML layouts with Flexbox flex container
  12. 12. HTML layouts with Flexbox flex container display: flex | inline-flex
  13. 13. HTML layouts with Flexbox flex container flex items
  14. 14. Flex Container flex-direction vertical horizontal
  15. 15. Flex Container flex-wrap wrap no-wrap
  16. 16. Flex Container justify-content: flex-start
  17. 17. Flex Container justify-content: flex-end
  18. 18. Flex Container justify-content: center
  19. 19. Flex Container justify-content: space-between
  20. 20. Flex Container justify-content: space-around
  21. 21. Flex Container align-items: flex-start
  22. 22. Flex Container align-items: flex-end
  23. 23. Flex Container align-items: center
  24. 24. Flex Container align-items: stretch
  25. 25. Flex Container align-items: baseline hola hi hey howdy
  26. 26. Flex Container align-content: flex-start
  27. 27. Flex Container align-content: flex-end
  28. 28. Flex Container align-content: center
  29. 29. Flex Container align-content: stretch
  30. 30. Flex Container align-content: space-between
  31. 31. Flex Container align-content: space-around
  32. 32. Flex Items order: 1
  33. 33. Flex Items order: 2
  34. 34. Flex Items order: 3
  35. 35. Flex Items flex-grow: 1
  36. 36. Flex Items flex-grow: 1
  37. 37. Flex Items flex-grow: 1
  38. 38. Flex Items flex-grow: 1
  39. 39. Flex Items flex-grow: 2
  40. 40. Flex Items flex-grow: 1
  41. 41. Flex Items flex-shrink: 1
  42. 42. Flex Items flex-shrink: 2
  43. 43. Flex Items flex-shrink: 1
  44. 44. Flex Items flex-basis: 20em
  45. 45. Flex Items flex: 2 1 50em
  46. 46. Flex Items flex: 2 1 50em flex-grow
  47. 47. Flex Items flex: 2 1 50em flex-shrink
  48. 48. Flex Items flex: 2 1 50em flex-basis
  49. 49. Flex Items align-self: flex-start align-self: flex-end
  50. 50. Internet Explorer 9 and below…
  51. 51. Internet Explorer 9 and below… Canada: 7.5% rapidly shrinking
  52. 52. So what do we do now?
  53. 53. So what do we do now? pureCSS grid module uses inline-block for <= IE9 <div class="pure-g"> <div class="pure-u-1-3"><p>Thirds</p></div> <div class="pure-u-1-3"><p>Thirds</p></div> <div class="pure-u-1-3"><p>Thirds</p></div> </div> Works very well if you know how many columns
  54. 54. So what do we do now? pureCSS grid module uses inline-block for <= IE9 <div class="pure-g"> <div class="pure-u-1-3"><p>Thirds</p></div> <div class="pure-u-1-3"><p>Thirds</p></div> <div class="pure-u-1-3"><p>Thirds</p></div> </div> jQuery insertAfter() re-order with javascript <div class=“order-3”> <div class=“order-1”> <div class=“order-2”> <div class=“order-3”> $(window).resize(function() { if ($(window).width() < 960) { $(“.order-3”).insertAfter( $(“.order-2”) );
  55. 55. So what do we do now? a { display: -webkit-box; display: -webkit-flex; display: -moz-box; display: -ms-flexbox; display: flex } a { display: flex; } Autoprefixer post-processor
  56. 56. Holy Grail Layout header, footer, three columns • Has a fluid center with fixed-width sidebars • Center column should appear first in the HTML • Columns should be the same height • Minimal markup • The footer should "stick" to the bottom of the page when content is sparse http://codepen.io/adamskye/pen/OPJKEP

×