Recommended Free Tools
CSS media queries apply styles only when the viewing environment meets conditions you specify, such as a viewport width, input capability, or user preference. For responsive layouts, start with flexible styles that work at narrow widths, then add a query when the content needs a different arrangement—not when a device reaches a supposedly universal breakpoint.
How media queries work
A media query tests the rendering environment. When its media type and feature conditions match, the browser applies the enclosed CSS rules; when they do not, those rules do not apply. Queries can test viewport width, orientation, display resolution, input capabilities, and preferences such as reduced motion or dark color scheme. MDN’s CSS media queries guide describes the available categories and syntax.
Basic syntax
@media screen and (width >= 80rem) {
.container {
margin: 1em 2em;
}
}
screen is a media type; it is optional. (width >= 80rem) is a feature expression using modern range syntax. The rules inside the braces apply only when the query matches. MDN’s guide to using media queries covers the syntax and how queries may be used in stylesheets.
Combining conditions
Use and to require multiple conditions. A comma-separated query list means “either condition is sufficient.” The logical operators not and only are also available. A query matches when its media type matches and all feature expressions joined with and are true.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, 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 minute#1 Best Overall
- 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.
/* Both conditions must match. */
@media screen and (width >= 48rem) and (orientation: landscape) {
.sidebar {
display: block;
}
}
/* Either condition can match. */
@media print, screen and (width >= 80rem) {
.content {
color: #222;
}
}
Build responsive layouts around the content
Begin with a layout that can flex: use flexible grids, relative sizing, and sensible minimum or maximum constraints. Add a media query when a real design change is needed, such as moving from one column to two. Media queries complement fluid layout techniques; they are not mandatory if flexible sizing already solves the problem. MDN’s responsive design guide explains this content-led approach.
Example: a list that gains columns when there is room
.article-list {
display: grid;
grid-template-columns: 1fr;
gap: 1rem;
}
@media (width >= 42rem) {
.article-list {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}
@media (width >= 68rem) {
.article-list {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
}
The example starts with one column and adds columns at widths chosen for the design. Treat 42rem and 68rem as illustrative values, not standards: adjust them after checking whether the actual content fits comfortably. Relative units such as rem are preferable to breakpoints tied to a particular device model.
Choose breakpoints by checking the layout
- Start with the narrow layout and make sure the content remains readable and usable.
- Widen the available space gradually, watching for cramped text, awkward wrapping, or unused room.
- Add a breakpoint where a different layout would improve the content—for example, where cards can sit side by side without becoming too narrow.
- Check widths both below and above that point, as well as the space between any additional breakpoints.
There is no universal breakpoint table that fits every design. A media query describes a condition, not an exact phone, tablet, or desktop model. Prefer viewport features such as width over device-specific dimensions, which Media Queries Level 4 deprecated for responsive work.
Rank #2
- 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.
Use media features for capabilities and preferences
Width is only one possible condition. Use other features when the design genuinely needs to adapt to orientation, available input, or a user preference. These queries describe an environment or capability; they do not identify an exact device.
Orientation
@media (orientation: landscape) {
.gallery {
grid-template-columns: 1fr 1fr;
}
}
Use orientation when the content benefits from the available landscape arrangement. Do not assume landscape always means a large viewport; the width and height can still be limited.
Hover and pointer capability
@media (hover: hover) and (pointer: fine) {
.card a:hover {
text-decoration: underline;
}
}
This is appropriate for an enhancement that relies on a fine pointer and hover. Do not make essential actions available only on hover: an input-capability query is not a guarantee that every user input has that property.
Rank #3
- 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.
Reduced motion
@media (prefers-reduced-motion: reduce) {
.animated-element {
animation: none;
scroll-behavior: auto;
}
}
Use this preference to reduce nonessential movement for people who request less motion. Make the reduced-motion styles fit the behavior of the component; removing animation should not hide content or make an interaction unclear.
Dark color scheme
@media (prefers-color-scheme: dark) {
:root {
color-scheme: dark;
--page-background: #171717;
--page-text: #f2f2f2;
}
}
The query lets a stylesheet respond to the color scheme preference indicated by the user agent. Ensure text, controls, and other important content remain legible in the resulting colors.
Forced colors
The forced-colors feature can be useful when adapting an interface to a forced-color environment. Avoid overriding the user’s color choices without a specific need, and check that meaning remains clear when the palette is simplified. Media query features and their roles are documented in MDN’s media query fundamentals guide.
Rank #4
- 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
Use container queries for reusable components
A media query responds to the page’s rendering environment, commonly the viewport. That is a good fit for page-level decisions such as changing a main layout from one column to two. A reusable component may instead need to respond to the space available in its own parent—for example, a card used in both a narrow sidebar and a wide content area. Consider a container query for that case so the component follows its container rather than the overall viewport. See MDN’s overview of media queries for the distinction between environment-level and container-based adaptation.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Print styles and media types
Media types include all, print, and screen. Use print for rules that should change the output on paper, such as removing navigation or adjusting contrast.
@media print {
nav,
.screen-only {
display: none;
}
a {
color: #000;
text-decoration: underline;
}
}
Older media types such as tv and handheld are deprecated; do not use them as device-targeting shortcuts.
Best Value
- 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.
Common mistakes and troubleshooting
A breakpoint works on one screen but the layout still breaks elsewhere
Cause: The breakpoint was selected for a device category or a single width rather than for the content. Fix: Check the design across the widths where it becomes cramped or has room to change. Use flexible base styles and add or adjust breakpoints where the content calls for them.
A hover-only interaction is unavailable to some users
Cause: An essential action depends on a mouse-like input. Fix: Keep the action accessible without hover; use hover and pointer queries only for enhancements that genuinely depend on those capabilities.
A rule in a media query does not appear to apply
Cause: The query condition may not match the current environment, or another applicable rule may take precedence in the cascade. Fix: Check each condition independently, then inspect the element’s matched rules and computed styles in browser developer tools. Confirm that the query is testing the intended feature, such as viewport width, rather than an outdated device dimension.
A nonmatching stylesheet seems to load anyway
A stylesheet linked with a nonmatching media query can still download, potentially at lower priority; its rules simply do not apply unless the query matches. Do not treat the media attribute as a guarantee that the file will not be downloaded. MDN’s usage guide explains this behavior.
Or skip the browser setup
To capture a rendered page while checking a responsive design, ScreenshotNeo can return a screenshot or PDF from one API request. Its API supports device presets and custom viewports, and its MCP server gives AI agents screenshot and page-information tools.
Quick Recap
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. Cookie banners, popups, and chat widgets are removed before capture; bot checks, blank pages, and failed loads are never billed. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Sign up free for ScreenshotNeo.
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.

