My Docs
BlogGithubLinkedin
Cheat Sheets
Cheat Sheets
  • πŸ“‹Cheat Sheets
    • Files
    • Terminal Cheat Sheet
    • Flexbox Cheat Sheet
    • Common HTTP status codes Cheat Sheet
    • networking_cheatsheet
    • Regular Expressions Cheat Sheet
    • REGEX units Cheat Sheet
  • bash_cheatsheet
  • Google dork cheatsheet
  • Cheatsheet-v2
  • πŸ•ΈοΈπŸ’» πŸ’» Javascript
    • JavaScript
      • Javascript Python cheatsheet
      • General
        • JavaScript Promise API Cheat Sheet
        • Chai.js
        • Canvas
        • ES6 EXPORTS
        • Asynchronous JavaScript Cheat Sheet
      • React
        • React Cheat Sheet
          • React Component Guide
        • React Patterns:
        • react-examples
        • React.js
          • Bootstrap
        • React.js cheatsheet 2
        • React-router
        • React.js (v0.14)
        • React.js
        • React Patterns:
      • βš–οΈLibraries & Frameworks
        • LOADASH Cheat Sheet
        • sequelize_cheatsheet
        • Sequelize Cheatsheet
      • Node & Express
        • ExpressJS Cheat Sheet
      • CHEATSHEET
      • NPM Cheat Sheet
        • NPM Command Line Cheat Sheet
      • Function Context Cheatsheet
      • js-model
  • πŸ’»CS-Concepts
    • Computer Science Concepts
      • Data Structures
        • The Queue data structure
        • Cheat Sheet for Beginners: JavaScript Data Structures Methods
        • MDN Web Docs Glossary: Definitions of Web-related terms \| MDN
        • Data Structures Cheat Sheet
        • The Tree data structure
        • An Executable Data Structures Cheat Sheet for Interviews
      • networking_cheatsheet
  • Tools
    • πŸ› οΈTools
      • VSCODE Cheat Sheet
      • Emmet
  • πŸ“ΌGuides-Tutorials
    • Tutorials
      • React.js
  • JavaScript Arrays
  • editorconfig
  • AWS CLI
  • ES6 EXPORTS
  • Flynn
  • Github
    • Github
      • Github Cheat Sheet
    • git log
    • GITHUB Cheat Sheet
      • An Executable Data Structures Cheat Sheet for Interviews
      • graphs_cheatsheet
  • General
    • General
  • πŸ‘¨β€πŸ’»πŸ‘¨πŸ’» πŸ‘¨πŸ’» πŸ’» Programming Languages
    • 🐍Python:
      • Python
        • What is Python
      • Regex In Python
    • HTML
  • EC2 API tools
    • MARKDOWN
    • πŸ§˜β™‚ PSQL
      • POSTGRES
      • postgreSQL_cheatsheet
  • ES6 IMPORTS
    • bash_cheatsheet
    • cleancode
    • πŸ”¨Bash
      • Bash Cheat Sheet
      • Learn Bash Scripting: Bash Scripting Cheatsheet
      • Curl
      • Bash Shortcuts Cheat Sheet
      • SSH Cheatsheet
      • Linux
    • CSS
      • CSS
        • CSS Grid
        • cssnext
        • CSS Cheat Sheet
        • CSS Flex Box
        • CSS tricks
        • CSS selectors
        • cssnext
        • CSS background
        • CSS animations
    • Typescript
  • Computer Science Concepts
    • An Executable Data Structures Cheat Sheet for Interviews
    • graphs_cheatsheet
    • networking_cheatsheet
    • Firebase
    • networking_cheatsheet
    • πŸ›Heroku Cheat Sheet
    • Binary Tree
  • πŸ“šDocs
    • Docs
      • editorconfig
      • EC2 API tools
      • Asynchronous JavaScript Cheat Sheet
      • CHEATSHEET (3)
      • js-model
      • Emmet
      • Binary Tree
      • Python
      • Contributor Covenant Code of Conduct
      • networking_cheatsheet
      • Common HTTP status codes Cheat Sheet
      • AWS CLI
      • Linux
      • networking_cheatsheet
      • React Patterns:
      • MDN Web Docs Glossary: Definitions of Web-related terms \| MDN
      • JavaScript Arrays
      • Linux
      • Javascript Python cheatsheet
      • Cheatsheet-v2
      • Binary Tree
      • Heroku Cheat Sheet
      • Asynchronous JavaScript Cheat Sheet
      • Cheatsheet Compilation
      • AWS CLI
      • EC2 API tools
      • Common HTTP status codes Cheat Sheet
      • Firebase
      • The Queue data structure
      • Cheat Sheet for Beginners: JavaScript Data Structures Methods
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. Cheat Sheets

Flexbox Cheat Sheet

Container

  • display: flex or display: inline-flex: creates a flex context (or an inline flex context) for direct children of this element

  • flex-direction determines the main and cross axis for the container, valid values are:

    • row (default): horizontal, in the direction of writing (left to right for English)

    • row-reverse: horizontal, in the opposite direction of writing (right to left for English)

    • column: vertical, top to bottom

    • column-reverse: vertical, bottom to top

  • flex-wrap determines if flex items will try to fit in one line, valid values are:

    • nowrap (default): all flex items will be on one line

    • wrap: flex items will wrap onto multiple lines, top to bottom

    • wrap-reverse: flex items will wrap onto multiple lines, bottom to top

  • flex-flow: shorthand combining flex-direction and flex-wrap

    • Formal syntax: flex-flow: <'flex-direction'> || <'flex-wrap'>

  • justify-content defines the alignment along the main axis, valid values are:

    • flex-start (default): pack flex items from the start

    • flex-end: pack flex items from the end

    • start: pack items from the start

    • end: pack items from the end

    • left: pack items from the left

    • right: pack items from the right

    • center: pack items around the center

    • space-around: distribute items evenly with equal space around them

    • space-between: distribute items evenly with equal space between them

    • space-evenly: distribute items evenly, ensuring equal space between any two items

    • stretch: distribute items evenly, stretching auto-sized items to fit the container

  • align-items defines the alignment along the cross axis, valid values are:

    • flex-start (default): pack flex items from the start

    • flex-end: pack flex items from the end

    • start: pack items from the start

    • end: pack items from the end

    • center: pack items around the center

    • baseline: align items based on their baselines

    • stretch: stretch items to fill the container

  • align-content defines the alignment of extra space along the cross axis, valid values are:

    • flex-start (default): pack flex items from the start

    • flex-end: pack flex items from the end

    • start: pack items from the start

    • end: pack items from the end

    • center: pack items around the center

    • space-around: distribute items evenly with equal space around them

    • space-between: distribute items evenly with equal space between them

    • space-evenly: distribute items evenly, ensuring equal space between any two items

    • stretch: distribute items evenly, stretching auto-sized items to fit the container

Items

  • flex-grow determines how much the item can grow if necessary

    • Accepts a single positive number (unitless), default value is 0

    • Specifies how much of the remaining space in the flex container should be assigned to the item

    • The remaining space is the size of the flex container minus the size of all flex items' sizes together

    • If all items have the same flex-grow, all items will receive an equal share of the remaining space

    • If not all items have the same flex-grow, the remaining space is distributed according to the ratio defined by these values

  • flex-shrink determines how much the items can shrink if necessary

    • Accepts a single positive number (unitless), default value is 1

    • If the size of all flex items is larger than the flex container, items shrink to fit according to flex-shrink

  • flex-basis determines the initial size of a flex item before the remaining space is distributed

    • Can use any valid width value, intrinsic size values, auto (default) or content

    • auto means "look at my width or height property", whereas content is used for automatic sizing

  • flex: shorthand combining flex-grow, flex-shrink and flex-basis

    • Formal syntax: flex: none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ]

  • align-self allows the item to override the default align-items specified by the container

    • Valid values are the same as those of the align-items property in the container

  • order determines the ordering of the item

    • Accepts an integer value

    • Items in a container are sorted by ascending order value and then by their source code order

    • Might cause accessibility issues if used incorrectly

PreviousTerminal Cheat SheetNextCommon HTTP status codes Cheat Sheet

Last updated 3 years ago

Was this helpful?

πŸ“‹