To build a responsive page with Bootstrap 5, include the viewport meta tag, wrap the layout in a container, and use grid classes such as .col-12 col-md-6 to stack content on narrow screens and place it side by side from the medium breakpoint upward. Add Bootstrap’s JavaScript bundle if you use interactive components such as a collapsing navbar, and use .img-fluid for content images.
This example uses Bootstrap 5.0’s setup, grid, and navbar conventions; its image guidance links to the Bootstrap 5.3 figures documentation. Keep snippets and assets on the same Bootstrap major version. See the Bootstrap 5.0 introduction and the Bootstrap 5.0 breakpoints documentation.
Start with a version-matched HTML page
The viewport tag tells mobile browsers to size the page to the device width and use the intended initial scale. Without it, a mobile browser may lay out the page as if it were a wider desktop viewport and scale it down, making text and responsive behavior seem wrong.
For a simple starter, Bootstrap’s official getting-started page provides CDN setup. For a project with dependency management, install Bootstrap through your project’s package manager and load the CSS and JavaScript from the installed package. In either case, make sure the CSS and JavaScript are from the same Bootstrap major version; component markup and plugin behavior can differ between versions.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →#1 Best Overall
- CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
- WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
- A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Responsive Bootstrap page</title>
<!-- Add the Bootstrap 5 stylesheet using the official setup instructions. -->
</head>
<body>
<main class="container py-4">
<h1>Responsive page</h1>
<p>Start with the content, then choose where its layout should change.</p>
</main>
<!-- Add the Bootstrap 5 JavaScript bundle if the page uses interactive components. -->
</body>
</html>
The comments mark the two framework assets to add using the version-matched instructions on the Bootstrap 5.0 introduction page. A page without interactive plugins can omit the JavaScript; the CSS alone handles the grid and responsive utilities.
Choose the content wrapper
Bootstrap’s grid needs a container wrapper. Choose between a responsive maximum-width wrapper and one that remains full width based on the design, rather than assuming one is always preferable.
.containergrows through responsive maximum widths at Bootstrap’s breakpoint tiers. It keeps long lines from spanning the full width on larger screens..container-fluidstays 100% wide at every viewport size. It suits layouts intended to use all available horizontal space.
These wrappers also supply horizontal padding for the grid. Details of the Bootstrap 5.0 container behavior are in the containers documentation.
Build a layout that changes with its content
Bootstrap’s grid is based on 12 columns. Put columns in a .row, then use breakpoint classes to tell Bootstrap how much width each column should take. A class such as .col-md-6 applies at the medium breakpoint and wider; below that threshold, the column can take the full row width.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Rank #2
- CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
- SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
<main class="container py-4">
<div class="row g-3">
<section class="col-12 col-md-6">
<div class="p-3 border rounded">
<h2>First area</h2>
<p>This occupies a full row on narrow screens and half the row at md and wider.</p>
</div>
</section>
<section class="col-12 col-md-6">
<div class="p-3 border rounded">
<h2>Second area</h2>
<p>The matching column sits beside the first when there is enough room.</p>
</div>
</section>
</div>
</main>
.col-12 makes each section span the full 12-column row at the base size. .col-md-6 changes each to six of 12 columns at md and above. The g-3 class adds gutters between grid items. A row can contain more columns than fit on one line; Bootstrap wraps them onto another line.
Bootstrap 5.0 default breakpoints
| Tier | Viewport width | How to read it |
|---|---|---|
| xs | Below 576px | Base styles, with no breakpoint infix |
| sm | 576px and wider | -sm- styles begin here |
| md | 768px and wider | -md- styles begin here |
| lg | 992px and wider | -lg- styles begin here |
| xl | 1200px and wider | -xl- styles begin here |
| xxl | 1400px and wider | -xxl- styles begin here |
These are viewport-width thresholds, not promises that a particular phone, tablet, or laptop uses a specific tier. Bootstrap describes the defaults as a foundation for common viewport sizes; Sass breakpoints can be customized. Pick a transition where your actual content begins to feel crowded or unnecessarily spread out, then test around that width. The values above are from the Bootstrap 5.0 breakpoint documentation.
Make navigation collapse at the right width
Use a semantic <nav> landmark and a .navbar-expand-* class to select where a navbar becomes expanded. In this example, .navbar-expand-md keeps the links collapsed below md and expanded at md and above. The button’s target ID must exactly match the collapsible element’s ID.
<nav class="navbar navbar-expand-md navbar-light bg-light">
<div class="container">
<a class="navbar-brand" href="#">Site name</a>
<button class="navbar-toggler" type="button"
data-bs-toggle="collapse" data-bs-target="#siteNavigation"
aria-controls="siteNavigation" aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="siteNavigation">
<ul class="navbar-nav ms-auto">
<li class="nav-item"><a class="nav-link" href="#about">About</a></li>
<li class="nav-item"><a class="nav-link" href="#contact">Contact</a></li>
</ul>
</div>
</div>
</nav>
The toggler needs Bootstrap’s JavaScript collapse plugin. The Bootstrap 5 JavaScript bundle includes the pieces needed for this component; add it following the version-matched setup instructions. If instead you load plugins as separate scripts, Popper must be loaded before plugins such as tooltips or popovers. See the Bootstrap 5.0 navbar documentation for the responsive navbar conventions.
Rank #3
- Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
- Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
- Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
- In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
- Ultra-thin bezels: Maximize your viewing experience with thin bezels.
Keep images and other content within the viewport
For content images, add .img-fluid. It applies a responsive maximum width and automatic height so an image can shrink to fit its parent without distorting its aspect ratio.
<img src="images/team.jpg" class="img-fluid" alt="The project team in a meeting">
Choose meaningful alternative text for informative images; use empty alternative text for images that are purely decorative. The Bootstrap 5.3 figures documentation describes .img-fluid. If the rest of your page uses Bootstrap 5.0, treat that link as the image utility reference rather than a reason to mix 5.3 component markup into a 5.0 page.
Test the responsive behavior
Responsive classes make layout changes, but they cannot decide whether a particular design remains readable. Check the rendered page at narrow and wide viewport widths, including widths near each breakpoint you rely on. Resize the browser or use its responsive device toolbar, then inspect the content rather than targeting device names.
- Check for horizontal scrolling and elements that extend beyond the viewport.
- Confirm headings, buttons, and navigation links remain visible and usable when columns stack.
- Inspect around the transition width as well as at the smallest and largest widths you support.
- Check images and long strings, tables, or code samples that may overflow even when the grid itself is responsive.
- Try the navbar toggler with a pointer and keyboard, and confirm its accessible label and expanded state are present.
Troubleshoot common Bootstrap responsiveness problems
The mobile layout looks like a scaled-down desktop page
Check that the document head includes <meta name="viewport" content="width=device-width, initial-scale=1">. Also check that the browser is loading the intended stylesheet and that custom CSS is not imposing a wide fixed width.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Rank #4
- CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
- SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
- MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
- KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
- INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
The navbar button appears but does nothing
The collapse component requires Bootstrap JavaScript. Add the version-matched bundle, check the browser console for load errors, and verify that data-bs-target="#siteNavigation" points to an element whose ID is exactly siteNavigation. Bootstrap 5 uses data-bs-* attributes; snippets from older major versions may use incompatible markup.
Columns do not line up or the grid has unexpected spacing
Put the row inside a container and put the columns directly inside the row. Use columns as the grid items and place inner content in a nested element when you need padding or a border. A missing container or a mismatched row/column structure can make gutters and alignment behave unexpectedly.
A breakpoint change happens earlier or later than expected
Breakpoint infixes apply at the stated width and above, not only at one exact screen size. For example, .col-md-6 takes effect at 768px and continues to apply at larger widths unless another rule overrides it. Inspect the actual viewport width and check whether project Sass settings have customized Bootstrap’s defaults.
Content still overflows despite responsive columns
A grid cannot automatically make every child element shrink. Check for fixed-width images or embedded content, long unbroken text, and custom minimum widths. Use .img-fluid for content images and adjust the particular overflowing element rather than hiding all overflow, which can conceal content.
Best Value
- 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
- 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
- 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
Or skip the browser setup
If the goal is to capture a rendered page rather than implement the layout yourself, ScreenshotNeo is a website screenshot API and MCP server from Yorker Media. Its API takes a URL in one GET request and can return a PNG, JPEG, WebP, or PDF. One cURL example:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options and response details. It accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers indicate the page verdict and billing status. Its MCP server offers take_screenshot, get_page_info, and capture_pdf for AI agents and MCP clients. The free plan includes 1,000 shots per month without a card; paid plans start at $5 for 3,000 shots.
Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.
Frequently Asked Questions
Do I need Bootstrap JavaScript for a responsive grid?
No. The grid and responsive CSS utilities work without the JavaScript bundle. Interactive components such as a collapsing navbar need the relevant Bootstrap JavaScript plugin.
Recommended Free Tools
Can I change Bootstrap’s default breakpoints?
Yes. Bootstrap’s breakpoint documentation describes its Sass breakpoints as customizable; a project must compile the customized Sass for those values to affect its CSS.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

