CSS: Flexbox & Grid
58 cards · 🇺🇸 English
Layout with CSS Flexbox and Grid.
Study all 58 cards for free
Flashcards, quizzes, pixel-art games and a daily review that remembers for you.
Try the first 10 cards
1 / 10Flexbox
Tap the card for the answer · swipe right if you knew it, left if not
Already have an account? Sign in
Cards
- 1FlexboxA CSS layout module for creating one-dimensional layouts (row or column). It allows flexible sizing and alignment of items along a main axis.
- 2Create a flex containerApply display: flex or display: inline-flex to an element. Its direct children automatically become flex items.
- 3Main axis in FlexboxThe primary axis along which flex items are laid out. Direction is set by flex-direction (row = horizontal, column = vertical).
- 4Cross axis in FlexboxThe axis perpendicular to the main axis. If main axis is horizontal (row), cross axis is vertical, and vice versa.
- 5Values for flex-directionrow (default, left to right), row-reverse, column (top to bottom), column-reverse. Sets the main axis direction.
- 6Justify-contentAligns flex items along the main axis. Values: flex-start, flex-end, center, space-between, space-around, space-evenly.
- 7Align-itemsAligns flex items along the cross axis. Values: stretch (default), flex-start, flex-end, center, baseline.
- 8Align-selfOverrides align-items for individual flex items. Allows one item to have different cross-axis alignment than its siblings.
- 9Flex-wrapControls whether flex items wrap onto multiple lines. Values: nowrap (default, single line), wrap, wrap-reverse.
- 10Align-contentAligns multiple lines of flex items along the cross axis when there's extra space. Only works with flex-wrap: wrap.
- 11Flex property shorthandflex: [flex-grow] [flex-shrink] [flex-basis]. Example: flex: 1 0 auto means grow, don't shrink, auto basis.
- 12Flex-growDefines the ability for a flex item to grow if necessary. Default 0. Value is a proportion (flex-grow: 2 grows twice as much as 1).
- 13Flex-shrinkDefines the ability for a flex item to shrink if necessary. Default 1. Value 0 prevents shrinking.
- 14Flex-basisDefines the default size of an element before remaining space is distributed. Default auto. Can be length (px, %, em) or keyword.
- 15Flex: 1Shorthand for flex: 1 1 0, meaning the item can grow and shrink, with a basis of 0. Items will share space equally.
- 16Center an item with FlexboxOn the container: display: flex; justify-content: center; align-items: center. Centers along both axes.
- 17CSS GridA two-dimensional layout system for creating complex layouts with rows and columns. More powerful than Flexbox for page-level layouts.
- 18Create a grid containerApply display: grid or display: inline-grid. Direct children become grid items.
- 19Grid-template-columnsDefines the columns of the grid. Example: grid-template-columns: 200px 1fr 2fr creates 3 columns with specified widths.
- 20Grid-template-rowsDefines the rows of the grid. Example: grid-template-rows: 100px auto 50px creates 3 rows with specified heights.
- 21Fr unit in CSS GridFractional unit representing a fraction of available space. 1fr 2fr means second column gets twice the space of the first.
- 22Repeat()Repeats a pattern. repeat(3, 1fr) creates 3 equal columns. repeat(auto-fit, minmax(200px, 1fr)) creates responsive columns.
- 23Grid-gap (gap)Creates spacing between grid items. gap: 20px (all), or row-gap and column-gap separately. Modern syntax is just gap.
- 24Grid-columnShorthand for grid-column-start / grid-column-end. Positions item across columns. grid-column: 1 / 3 spans columns 1-2.
- 25Grid-rowShorthand for grid-row-start / grid-row-end. Positions item across rows. grid-row: 2 / 4 spans rows 2-3.
- 26Span multiple columns/rowsgrid-column: span 2 spans 2 columns, grid-row: span 3 spans 3 rows. Or use line numbers: grid-column: 1 / 4.
- 27Grid-areaShorthand for grid-row-start / grid-column-start / grid-row-end / grid-column-end, or a named area.
- 28Grid-template-areasDefines named grid areas using a visual ASCII-art syntax. Items are placed using grid-area: <name>.
- 29Give an example of grid-template-areas syntax.grid-template-areas: 'header header' 'sidebar main' 'footer footer'; Creates 3 rows, 2 columns with named regions.
- 30Grid-auto-flowControls how auto-placed items are inserted. Values: row (default), column, dense (fills holes).
And 28 more cards. Study the whole deck free
Articles about this deck
More Programming decks
See all- 🌐
APIs: REST, GraphQL & HTTP Status Codes
108 cards · 🇺🇸 English
REST and GraphQL API concepts plus common HTTP status codes.
- 🎨
CSS: Box-Modell, Selektoren & Media Queries
129 cards · 🇺🇸 English
Das CSS-Box-Modell, Selektortypen, Media Queries und Animationen.
- 📄
HTML : balises et attributs
99 cards · 🇺🇸 English
Éléments HTML essentiels et leurs attributs.
- 🎨
CSS: Box Model, Selectors & Media Queries
129 cards · 🇺🇸 English
The CSS box model, selector types, media queries, and animations.
- 🔒
Web Security: OWASP & Authentication
35 cards · 🇺🇸 English
Common web vulnerabilities (OWASP Top 10) and authentication concepts.
- 🎨
CSS : Flexbox et Grid
58 cards · 🇺🇸 English
Mise en page avec CSS Flexbox et Grid.
