Content-focused layouts with centered alignment for optimal readability
This demonstrates how content looks at different container widths. The optimal line length for reading is typically between 50-75 characters per line, which affects how we choose our max-width values.
Notice how the reading experience changes as you adjust the container width. Narrower containers create shorter lines that are easier to scan, while wider containers allow for more content density but may reduce readability.
Optimal reading experience with centered content
max-w-3xlLorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Focused form experience with narrow container
max-w-md28remWide centered container for data visualization
max-w-6xl72remMarketing content with centered sections
max-w-5xlThe complete toolkit for modern web development. Build faster, ship sooner, and delight your users with our powerful design system.
px-4 md:px-8max-w-2xl md:max-w-4xlmax-w-6xl lg:px-12<div className="min-h-screen bg-muted py-12 px-4 sm:px-6 lg:px-8">
<div className="max-w-4xl mx-auto">
<div className="bg-white shadow rounded-lg p-6">
<AnchorHeading as="h1" className="text-3xl font-bold text-gray-900 mb-4">
Centered Content
</AnchorHeading>
<p className="text-muted-foreground">
Your main content goes here...
</p>
</div>
</div>
</div><div className="min-h-screen bg-background">
{/* Hero Section */}
<section className="py-20 px-4 sm:px-6 lg:px-8">
<div className="max-w-4xl mx-auto text-center">
<AnchorHeading as="h1" className="text-5xl font-bold text-gray-900 mb-6">
Welcome to Our Product
</AnchorHeading>
<p className="text-xl text-muted-foreground max-w-2xl mx-auto">
Centered hero content with constrained width for readability
</p>
</div>
</section>
{/* Features Section */}
<section className="py-16 px-4 sm:px-6 lg:px-8 bg-muted">
<div className="max-w-6xl mx-auto">
<AnchorHeading as="h2" className="text-3xl font-bold text-center mb-12">Features</AnchorHeading>
<div className="grid grid-cols-1 md:grid-cols-3 gap-8">
{/* Feature cards */}
</div>
</div>
</section>
{/* Article Section */}
<section className="py-16 px-4 sm:px-6 lg:px-8">
<div className="max-w-3xl mx-auto prose prose-lg">
<AnchorHeading as="h2">About Our Mission</AnchorHeading>
<p>Narrower container for optimal reading experience...</p>
</div>
</section>
</div>max-w-md28remmax-w-3xl48remmax-w-6xl72rem