Home/Explore/

Card layout

CSS Layout - Most popular layouts and patterns that can be built with CSS | Product Hunt Embed
<div style="
    display: flex;

    /* Put a card in the next row when previous cards take all width */
    flex-wrap: wrap;

    margin-left: -8px;
    margin-right: -8px;
">
    <!-- A card with given width -->
    <div style="
        /* There will be 4 cards per row */
        flex-basis: 25%;

        padding-left: 8px;
        padding-right: 8px;
    ">
        ...
    </div>

    <!-- Repeat other cards -->
    ...
</div>

Related patterns

Card

Simple grid

Subscribe to the newsletter for the latest layouts or patterns. No spam. Ever!