A .container centers content and applies responsive max-widths at each breakpoint. Use .container-fluid when edge-to-edge width is intentional (dashboards, hero bands).
Container variants
.container— responsive max-width per breakpoint.container-smthrough.container-xxl— fluid until the named breakpoint, then capped.container-fluid— always 100% width with horizontal padding
Compare Tailwind’s container mx-auto—same idea, different naming. Your HTML structure should still use meaningful landmarks (main, header) inside containers.
Self-check
- When would you pick
container-fluidovercontainer? - What does a container add besides max-width?