CSSCSS25 min read

CSS Grid Columns

Learn how grid columns work, fixed vs flexible units, and how responsive layouts are created using fr units.

David Miller
Dec 2, 2025
21.2k658
    Columns define **horizontal structure**.
    
    ## Common units
    - px → fixed
    - % → relative
    - fr → flexible (recommended)
    
    ## Example
    ```css
    .container {
      display: grid;
      grid-template-columns: 1fr 2fr 1fr;
    }
    ```
    
    ## UI imagination
    - 3 columns
    - Middle column is wider
    
    ## Real-world example
    - Product listing
    - Content + ads layout
    
    ## Key idea
    `fr` divides available space, not screen size.
    
#CSS#Beginner