101.school
CoursesAbout
Search...⌘K
Generate a course with AI...

    Advance CSS

    Receive aemail containing the next unit.
    • CSS Grid Layout
      • 1.1Introduction to grid-based systems
      • 1.2Working with rows and columns
      • 1.3Creating complex, responsive designs
    • CSS Flexbox
      • 2.1Flexbox techniques: alignment and layout
      • 2.2Flexbox controls for UI components
    • Responsive Web Design
      • 3.1Implementing media queries
      • 3.2Employing fluid design principles
    • CSS Preprocessors
      • 4.1Introduction to CSS preprocessors: Sass, Less, and Stylus
      • 4.2Streamlining styling with variables, mixins, and functions
    • CSS Custom Properties (Variables)
      • 5.1Incorporating custom properties in design
      • 5.2Crafting dynamic and themeable styles
    • CSS-in-JS Libraries
      • 6.1Survey of CSS-in-JS solutions
      • 6.2Scoped and encapsulated styles for components
    • Animations and Transitions
      • 7.1Keyframes animations with CSS
      • 7.2Implementing engaging transitions
    • Advanced Selectors and Pseudo-classes
      • 8.1Understanding pseudo-classes
      • 8.2Styling with advanced selectors
    • CSS Architecture and Methodologies
      • 9.1Introduction to BEM and SMACSS
      • 9.2Structuring scalable, organized CSS
    • CSS Transforms and 3D Effects
      • 10.1Introducing CSS transforms
      • 10.2Creating engaging visual effects
    • CSS Filters and Blend Modes
      • 11.1Understanding and applying CSS filters
      • 11.2Creating unique compositions using blend modes
    • Web Fonts and Icon Fonts
      • 12.1Integrating custom web fonts and icon fonts
      • 12.2Enhancing typography and visual elements
    • Accessibility and Inclusive Design
      • 13.1Understanding ARIA roles and attributes
      • 13.2Designing for diverse user needs

    CSS Flexbox

    Mastering Flexbox Properties

    development of a website for the Internet

    Development of a website for the Internet.

    Flexbox, or the Flexible Box Layout, is a powerful tool in CSS that allows for advanced layout alignment and distribution of space among items in a container. This article will delve into the various properties associated with Flexbox, providing a comprehensive understanding of their usage and effects.

    Flex Container Properties

    When you declare display: flex or display: inline-flex on an element, it becomes a flex container, and its children become flex items. The flex container properties control the layout of these flex items.

    flex-direction

    The flex-direction property determines the main axis, defining the direction in which the flex items are placed in the flex container. It accepts four values:

    • row: This is the default value. Flex items are laid out along the horizontal direction, from left to right.
    • row-reverse: Flex items are laid out from right to left.
    • column: Flex items are laid out vertically, from top to bottom.
    • column-reverse: Flex items are laid out from bottom to top.

    flex-wrap

    The flex-wrap property controls whether the flex items are forced onto one line or can wrap onto multiple lines. It accepts three values:

    • nowrap: This is the default value. All flex items will be on one line.
    • wrap: Flex items will wrap onto multiple lines, from top to bottom.
    • wrap-reverse: Flex items will wrap onto multiple lines, from bottom to top.

    flex-flow

    The flex-flow property is a shorthand for flex-direction and flex-wrap. The default value is row nowrap.

    justify-content

    The justify-content property aligns flex items along the main axis. It accepts six values:

    • flex-start: Items are packed toward the start of the line.
    • flex-end: Items are packed toward the end of the line.
    • center: Items are centered along the line.
    • space-between: Items are evenly distributed in the line; first item is on the start line, last item on the end line.
    • space-around: Items are evenly distributed in the line with equal space around them.
    • space-evenly: Items are distributed so that the spacing between any two items (and the space to the edges) is equal.

    align-items

    The align-items property defines the default behavior for how flex items are laid out along the cross axis. It accepts five values:

    • flex-start: Items are aligned to the start of the flex container.
    • flex-end: Items are aligned to the end of the flex container.
    • center: Items are centered in the flex container.
    • baseline: Items are aligned such as their baselines align.
    • stretch: Stretch to fill the container (still respect min-width/max-width).

    align-content

    The align-content property aligns a flex container's lines within the flex container when there is extra space in the cross-axis. It accepts six values similar to justify-content.

    Flex Items Properties

    Flex items have their own set of properties that control their size and order within the flex container.

    order

    The order property controls the order in which flex items appear within the flex container. By default, all flex items have an order of 0.

    flex-grow and flex-shrink

    The flex-grow property defines the ability for a flex item to grow if necessary. Similarly, flex-shrink defines the ability for a flex item to shrink if necessary. Both properties accept a unitless value that serves as a proportion.

    flex-basis

    The flex-basis property defines the initial main size of a flex item. It accepts any length unit or a keyword.

    flex

    The flex property is a shorthand for flex-grow, flex-shrink, and flex-basis.

    align-self

    The align-self property allows the default alignment (or the one specified by align-items) to be overridden for individual flex items.

    By understanding and mastering these properties, you can create complex layouts with ease using Flexbox.

    Test me
    Practical exercise
    Further reading

    Hey there, any questions I can help with?

    Sign in to chat
    Next up: Implementing media queries