Bootstrap 5 Grid Small

Creating responsive layouts for small devices

📱 What is Grid Small?

Bootstrap's small grid (sm) targets devices 576px and wider, like landscape phones and small tablets. It helps create responsive layouts that adapt beautifully to smaller screens using simple column classes.


<!-- Basic small grid example -->
<div class="container">
    <div class="row">
        <div class="col-sm-6">Column 1</div>
        <div class="col-sm-6">Column 2</div>
    </div>
</div>
                                    

Key Small Grid Concepts

📏

Breakpoint

Activates at 576px width

<div class="col-sm-12">Full width</div>
🔢

12 Columns

Grid divided into 12 parts

<div class="col-sm-4">4 columns</div>
📱

Mobile First

Stacks on extra small screens

<div class="col-sm-6">Half width</div>
🎯

Responsive

Adapts to screen size

<div class="col-sm-3">Quarter width</div>

🔹 Basic Small Grid Layout

Ideal for landscape phones and small tablets, the small grid creates two equal columns on devices 576px and wider using .col-sm-6 classes. On screens smaller than 576px, these columns stack vertically for optimal mobile viewing. This layout is perfect for simple side-by-side content comparisons, feature lists, or image-text pairings. Implementing a mobile-first approach by starting with stacked content and adding the .col-sm-* classes ensures a progressive enhancement that benefits SEO. Fast-loading, accessible, and well-structured small grid layouts improve user experience signals, which are critical ranking factors for search engines.

<div class="container">
    <div class="row">
        <div class="col-sm-6 bg-primary text-white p-3">
            Left Column
        </div>
        <div class="col-sm-6 bg-secondary text-white p-3">
            Right Column
        </div>
    </div>
</div>

Output:

Left Column
Right Column

🔹 Three Column Layout

Create balanced, tri-partite sections using .col-sm-4 classes, where each column consumes 4 of the 12 available grid units. This results in three equal-width columns ideal for displaying related content groups, such as service features, pricing tiers, or blog post excerpts, on small tablets and larger screens. On extra small devices (<576px), columns stack vertically to maintain readability and touch-friendly interaction. Using semantic headings and structured data within each column enhances content clarity for both users and search engines. This responsive, clean layout supports SEO by improving page engagement metrics and providing a solid foundation for keyword-rich, organized content.

<div class="container">
    <div class="row">
        <div class="col-sm-4 bg-info text-white p-3">
            Column 1
        </div>
        <div class="col-sm-4 bg-warning text-dark p-3">
            Column 2
        </div>
        <div class="col-sm-4 bg-success text-white p-3">
            Column 3
        </div>
    </div>
</div>

Output:

Column 1
Column 2
Column 3

🔹 Unequal Columns

Design custom, asymmetric layouts by mixing different column sizes that always sum to 12 within a single row. A common example is a wider main content area (e.g., .col-sm-8) paired with a narrower sidebar (.col-sm-4), perfect for blog layouts on small tablets. This flexibility allows you to prioritize important content while still accommodating secondary information. Ensuring the HTML structure follows a logical content hierarchy (main content before sidebar in the source order) benefits accessibility and SEO. Responsive unequal columns adapt gracefully across devices, improving user experience and supporting search engine rankings through mobile-friendliness and clear content prioritization.

<div class="container">
    <div class="row">
        <div class="col-sm-8 bg-primary text-white p-3">
            Main Content (8 columns)
        </div>
        <div class="col-sm-4 bg-secondary text-white p-3">
            Sidebar (4 columns)
        </div>
    </div>
</div>

Output:

Main Content (8 columns)
Sidebar (4 columns)

🔹 Auto Width Columns

On extra large screens (xl breakpoint, ≥1200px), utilize .col-xl classes without numbers to create flexible columns that automatically divide the available space equally. This is ideal for footers, complex navigation bars, or any component where you want content to fluidly occupy the expansive width of modern monitors without manual calculations. This approach maximizes screen real estate while maintaining a clean, proportional design. Ensuring content within these auto-width columns is valuable and well-structured is key. This layout strategy, when paired with high-quality content, enhances user experience on large screens, potentially increasing engagement metrics that are favorable for SEO across all device types.

<div class="container">
    <div class="row">
        <div class="col-sm bg-info text-white p-3">
            Auto Column 1
        </div>
        <div class="col-sm bg-warning text-dark p-3">
            Auto Column 2
        </div>
        <div class="col-sm bg-success text-white p-3">
            Auto Column 3
        </div>
    </div>
</div>

Output:

Auto Column 1
Auto Column 2
Auto Column 3

🔹 Column Wrapping

On extra large screens, leverage natural column wrapping to design sophisticated, magazine-style, or dashboard layouts where content flows across multiple rows. By intentionally using column unit totals that exceed 12 in a single .row, you can create dynamic grids for portfolios, card-based content, or data visualizations. This technique reduces the need for multiple, separate row containers and keeps the HTML semantic and DRY (Don’t Repeat Yourself). Clean, efficient HTML improves page load speed and crawlability for search engines. A well-executed wrapping layout that presents content in an engaging, scannable format can significantly improve user dwell time and reduce bounce rates—positive signals for SEO ranking algorithms.

<div class="container">
    <div class="row">
        <div class="col-sm-9 bg-primary text-white p-3">
            9 columns
        </div>
        <div class="col-sm-4 bg-secondary text-white p-3">
            4 columns (wraps to next line)
        </div>
        <div class="col-sm-6 bg-info text-white p-3">
            6 columns
        </div>
    </div>
</div>

Output:

9 columns
4 columns (wraps to next line)
6 columns

🧠 Test Your Knowledge

At what screen width does the small grid (sm) activate?