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

Flexbox a CSS layout technique that make sense

Flexbox a CSS layout technique that make sense

Maddane Motaquillah

February 10, 2016
Tweet

More Decks by Maddane Motaquillah

Other Decks in Programming

Transcript

  1. Flex-direction 1 2 3 Row Items flow from left to

    right *Default Container Main axis
  2. Flex-direction 1 2 3 Row Items flow from left to

    right *Default Container Main axis Cross axis
  3. Item order Item integer -1 1 2 the item with

    the lowest order will go first 1
  4. Item flex-basis Item css length unit the base length of

    the flex item equals the specified length 270px 3em 30%
  5. Item flex-grow Item flex-grow: x; * Positive number * Defines

    the ability of an item to grow when space is available 100px 20px 20px 0 0 Free space
  6. Item flex-grow Item flex-grow: x; * Positive number * Defines

    the ability of an item to grow when space is available 100px 20px Free space 1 20px 0
  7. Item flex-grow Item flex-grow: x; * Positive number * Defines

    the ability of an item to grow when space is available 100px 20px 20px 0 1
  8. Item flex-grow Item flex-grow: x; * Positive number * Defines

    the ability of an item to grow when space is available 100px 20px 20px 1 1
  9. Item flex-grow Item flex-grow: x; * Positive number * Defines

    the ability of an item to grow when space is available 100px 20px 20px 1 1
  10. Defines the ability of an item to shrink when there’s

    no available space Item flex-shrink
  11. Item flex-grow Item * Positive number * 40px 40px flex-shrink:

    x; Defines the ability of an item to shrink when there’s no available space
  12. Item flex-grow Item * Positive number * 60px 40px 40px

    flex-shrink: x; Defines the ability of an item to shrink when there’s no available space
  13. Item flex-grow Item * Positive number * 60px 40px 40px

    flex-shrink: x; 0 0 Defines the ability of an item to shrink when there’s no available space
  14. Item flex-grow Item * Positive number * 60px 40px 40px

    flex-shrink: x; 0 0 Defines the ability of an item to shrink when there’s no available space Needed space (20px)
  15. Item flex-grow Item * Positive number * 60px 40px 40px

    flex-shrink: x; 1 0 Defines the ability of an item to shrink when there’s no available space Needed space (20px)
  16. Item flex-grow Item * Positive number * 60px 20px 40px

    flex-shrink: x; 1 0 Defines the ability of an item to shrink when there’s no available space Needed space (20px)
  17. Item flex-grow Item * Positive number * 60px 20px 40px

    flex-shrink: x; 1 1 Defines the ability of an item to shrink when there’s no available space Needed space (20px)
  18. Item flex-grow Item * Positive number * 60px 30px 30px

    flex-shrink: x; 1 1 Defines the ability of an item to shrink when there’s no available space Needed space (20px)
  19. 95.31% * c a n i u s e .

    c o m /f l ex b ox *