What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Make a website responsive by letting its layout and media adapt to the space available, then add CSS media queries only where the content needs a different arrangement. Start with a fluid, narrow-screen-friendly layout, use Flexbox or Grid to distribute space, and test by gradually resizing the page—not by designing for a fixed list of phone and tablet models.

What responsive CSS should do

Responsive design is an approach to making pages work across different screen sizes and resolutions, as MDN describes in its responsive web design guide. The goal is not to make a separate fixed layout for every device. It is to make the same content remain usable as the available space changes.

That takes a few complementary techniques: normal document flow and flexible dimensions for the baseline, Flexbox or Grid for relationships between items, media queries for meaningful changes in layout or user-preference handling, and media rules that prevent images and video from overflowing.

Start with a fluid, narrow-screen-friendly baseline

Begin with a layout that can shrink to a narrow viewport. Avoid giving the whole page a fixed width that forces horizontal scrolling on a phone or leaves an awkwardly narrow column on a wide monitor. A centered content container can have a fluid width while retaining a comfortable maximum width:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
* {
  box-sizing: border-box;
}

.page {
  width: min(100% - 2rem, 70rem);
  margin-inline: auto;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

Here, the page has room for a one-rem gutter on each side when the viewport is narrow, but it stops growing at 70rem. The content starts in one column, a useful baseline when there is not enough space to place sections side by side. These values are examples, not universal design requirements.

Let ordinary document flow do as much work as possible. Text naturally wraps, and block elements naturally stack. Add special layout rules where the content relationship calls for them; do not begin by locking every region to desktop-sized pixel dimensions.

Use Flexbox or Grid before adding a breakpoint

Choose the layout tool that matches the component. Flexbox is useful when items need to share or distribute space along a row or column. Grid is useful when you want to define flexible tracks, such as a set of cards that form as many columns as fit.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Let a card grid adapt intrinsically

For example, this Grid rule creates as many columns as fit while keeping each card at least 16rem wide when space allows. If the container is narrower than that, the nested min() prevents the minimum track size from forcing overflow:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
}

Use intrinsic flexibility when the content can rearrange smoothly as space changes. A media query is useful when the content needs a distinct treatment, such as moving a sidebar beside the main column at a width where both can remain readable. Responsive behavior does not require a media query for every change.

Add breakpoints where the content needs them

Resize the page and look for the point where the design begins to fail: navigation items collide, columns become too tight, a text measure becomes uncomfortable, or controls are difficult to use. Add a breakpoint at that point. MDN’s media query guidance explains how conditional rules apply based on viewport and other environment characteristics; its responsive-design guidance recommends relative rather than device-specific breakpoint values.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

This example changes a one-column content grid into a main column and sidebar when there is enough room:

@media (width >= 48rem) {
  .content-grid {
    grid-template-columns: minmax(0, 2fr) minmax(14rem, 1fr);
  }
}

The 48rem threshold is illustrative, not a recommended breakpoint for every site. Pick a value based on your content and layout. Relative units help the threshold respond to text sizing rather than tying it to a device-model list. Before writing a new query, check whether Grid, Flexbox, normal flow, or flexible sizing already handles the space change well.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keep images and other media inside their containers

A simple CSS baseline prevents common overflow from images, pictures, and video:

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
img,
picture,
video {
  max-width: 100%;
  height: auto;
}

This scales media down to fit its containing block while preserving its natural aspect ratio. But CSS sizing does not choose a more efficient image file or a different crop. If a smaller screen should download a smaller source, or if a composition needs a different crop, use responsive HTML mechanisms such as srcset, sizes, or picture, as appropriate.

Set the mobile viewport in the HTML

Put this declaration inside the document’s <head>:

<meta name="viewport" content="width=device-width, initial-scale=1">

It tells mobile browsers to use the device width as the layout viewport instead of laying out the page against a wider, desktop-like viewport and shrinking the result. Without it, a carefully sized CSS layout may not behave at the expected mobile width.

Respect reduced-motion preferences

Responsive behavior can account for user preferences as well as viewport size. If the page uses animation or smooth scrolling, use the prefers-reduced-motion media feature to reduce nonessential motion for people who have requested it. MDN’s reduced-motion guidance describes this preference and CSS techniques for adapting to it.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto;
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
  }
}

This is one possible policy: it sharply reduces animation and transition duration when a user requests less motion. Review your own effects and preserve essential feedback or meaning rather than assuming every animation must always be removed.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Build and verify the page in a practical sequence

  1. Add the viewport declaration. Place the meta tag in the page head so mobile browsers use the device width.
  2. Remove unnecessary fixed widths. Let the page and components shrink or grow, and start with a narrow-screen-friendly arrangement.
  3. Choose the layout tool. Use normal flow for simple stacking, Flexbox for flexible item relationships, and Grid for track-based arrangements.
  4. Make media fit. Apply a container-safe CSS baseline, then use responsive image markup if source size or crop should vary.
  5. Resize gradually. Use browser responsive sizing tools to inspect narrow and wide viewports, then move between them to find where the content becomes cramped or over-expanded.
  6. Add only necessary media queries. Change the layout at the content’s failure point, and account for relevant user preferences such as reduced motion.
  7. Check the actual page behavior. Look for horizontal overflow, squeezed columns, escaping media, hard-to-read text measure, and navigation or controls that remain usable.

MDN documents browser viewport simulation in its responsive design material. A viewport emulator is a useful check, but still review the page’s content and interactive controls at the widths where its layout changes.

Troubleshoot common responsive CSS problems

The page scrolls horizontally on a narrow screen

  • Likely cause: A fixed-width container, a grid track with a large minimum, or media wider than its containing block.
  • Fix: Make the page width fluid, reconsider inflexible track minimums, and apply max-width: 100% to media. Inspect the element that extends beyond the viewport rather than hiding all overflow as a blanket fix.

Columns look cramped even though there is a breakpoint

  • Likely cause: The breakpoint is based on a device assumption rather than the width the content needs, or the column tracks cannot shrink appropriately.
  • Fix: Resize gradually and move the breakpoint to the point where the content needs a new arrangement. Use flexible Grid tracks such as minmax(0, 2fr) where appropriate.

Cards never wrap into a useful number of columns

  • Likely cause: The layout has a fixed column count or a minimum track width larger than the available container.
  • Fix: Consider intrinsic Grid sizing with auto-fit and a minimum that can contract on very narrow containers.

The mobile layout still appears scaled down

  • Likely cause: The document head is missing the viewport declaration.
  • Fix: Add <meta name="viewport" content="width=device-width, initial-scale=1"> and check the page again at the device width.

Images fit but look soft or show the wrong crop

  • Likely cause: CSS has scaled a single source to fit, but the design needs a smaller source or an alternate composition.
  • Fix: Use srcset and sizes for source selection, or picture when an alternate crop or source is appropriate.

Motion remains distracting for some visitors

  • Likely cause: The stylesheet does not account for the reduced-motion preference.
  • Fix: Add a prefers-reduced-motion: reduce rule and adapt nonessential animation, transitions, and smooth scrolling.

Or skip the browser setup

If you need screenshots while checking a responsive page, ScreenshotNeo can capture a URL using one GET request. For example, capture a page at a chosen viewport by adding the relevant parameters to the request; see the ScreenshotNeo API documentation for supported options and parameter names.

curl -G "https://api.screenshotneo.com/v1/shot" 
  -d access_key=YOUR_API_KEY 
  --data-urlencode url=https://example.com 
  -d width=390 
  -d height=844 
  -o shot.webp

ScreenshotNeo removes cookie or consent banners, newsletter popups, and chat widgets before capture. Bot checks, blank pages, and failed loads are not billed. Its MCP server lets AI agents—including Claude, Cursor, and other MCP clients—take screenshots. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 screenshots. Learn more at ScreenshotNeo, or sign up for the free plan.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.