What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
The CSS display property controls both how an element participates in the surrounding layout and how its children are arranged. Use block or inline to change its outer behavior, and use flex or grid when you need a different layout for its children. For most work, choose a value by asking two questions: what kind of box should this element create, and how should its contents be laid out?
How the two parts of display work
MDN Web Docs defines display as setting whether an element is treated as a block or inline box and the layout used for its children, such as flow, grid, or flex layout. These are the property’s outer and inner display types.
- Outer display: How the element participates in the surrounding flow, commonly as a block-level or inline-level box.
- Inner display: How the element’s child boxes are laid out, such as in normal flow, a flex layout, or a grid.
The familiar single-keyword values combine these dimensions. For example, flex means a block-level outer box with flex layout inside. The explicit form block flex expresses the same combination.
Compact and explicit syntax
| Compact value | Equivalent explicit value | What it does |
|---|---|---|
block |
block flow |
Block-level box with normal-flow children |
inline |
inline flow |
Inline-level box with normal-flow children |
flow-root |
block flow-root |
Block-level box that establishes a block formatting context |
inline-block |
inline flow-root |
Inline-level box with block formatting behavior inside |
flex |
block flex |
Block-level flex container |
inline-flex |
inline flex |
Inline-level flex container |
grid |
block grid |
Block-level grid container |
inline-grid |
inline grid |
Inline-level grid container |
If an inner type is omitted, it defaults to flow. If you use just flex or grid, the outer type defaults to block. The explicit syntax can make the two decisions easier to see, but there is no need to rewrite working compact values mechanically. MDN’s multi-keyword syntax guide shows using a legacy single-keyword value before its explicit equivalent when a fallback is needed; check support against the browsers you target.
#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.
Choose an outer box for ordinary flow
block
A block-level box participates as a block in surrounding flow, typically starting on a new line. Its children use normal flow by default.
.panel {
display: block;
}
inline
An inline-level box participates in a line of surrounding content rather than creating a block-level box. Its children use normal flow by default.
strong {
display: inline;
}
inline-block
inline-block keeps the element inline-level in its surroundings while giving it block formatting behavior inside. It is equivalent to inline flow-root.
.badge {
display: inline-block;
}
Arrange children with flexbox or grid
flex and inline-flex
Use flex when the element’s children should use flex layout and the container should be block-level. Use inline-flex when the flex container should participate as inline-level content.
Recommended Free Tools
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.
.row {
display: flex;
gap: 1rem;
}
.navigation {
display: inline-flex;
}
The explicit equivalent for the navigation rule is display: inline flex.
grid and inline-grid
Use grid to arrange children in a grid while the container is block-level, or inline-grid when it should be inline-level in surrounding content.
.cards {
display: grid;
grid-template-columns: repeat(2, 1fr);
}
The explicit form of inline-grid is inline grid.
Contain floats with flow-root
flow-root creates a block-level box that establishes a new block formatting context. According to MDN Web Docs’ block formatting context guide, such a context contains its internal floats, excludes external floats, and suppresses margin collapsing across the context boundary.
.clearfix {
display: flow-root;
}
This is useful when a container should account for floated children without adding extra markup. It is not the same as a flex or grid layout: children remain in flow unless other CSS changes their layout.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC 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 #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.
Use list-item for marker behavior
list-item creates a principal box and a ::marker box governed by list-style properties. It can make a non-list element render with list-item behavior, though semantic list markup is usually clearer when the content is actually a list.
.fake-item {
display: list-item;
}
MDN documents the value in its display-listitem reference.
Use table display values carefully
The table family of display values provides table-formatting roles; values such as table-row and table-cell correspond to parts of table structure. For tabular data, prefer semantic HTML elements such as <table>, <tr>, and <td> rather than trying to recreate table semantics with generic elements and CSS.
Changing a real <table> element’s display to block, grid, or flex can change its representation in the accessibility tree in some browsers, affecting screen-reader announcements. Test the actual browser and assistive-technology combinations your site supports before changing table layout this way.
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
Hide an element or remove only its box
display: none
display: none makes the element and its descendants generate no boxes, so they do not take up layout space.
.is-hidden {
display: none;
}
display: contents
display: contents removes the element’s own principal box while its child boxes remain in layout. This is different from hiding the whole subtree. Because the element’s box is removed, consider the effect on styling, semantics, and accessibility before applying it to meaningful structural elements.
.wrapper {
display: contents;
}
When to use visibility instead
Use visibility when an element should not be visibly rendered but should retain its layout space. Choose between it and display: none based on whether surrounding content should close up the gap.
Check browser support for less common values
The display property overall is widely available, but support can vary among individual values. MDN also documents ruby-related values and grid-lanes values; do not assume these are implemented across every browser. Check the relevant compatibility data for the exact value and browser matrix your project requires.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →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.
Build and inspect a page screenshot
To check how display changes affect a real page, you can capture it in a browser yourself. A minimal Playwright example navigates to a URL and saves a screenshot; install Playwright and its browser as described in its official documentation before running this script.
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage({ viewport: { width: 1280, height: 800 } });
await page.goto('https://example.com', { waitUntil: 'networkidle' });
await page.screenshot({ path: 'page.png', fullPage: true });
await browser.close();
Replace https://example.com with a page you can access. If a site never reaches network idle, use a deliberate wait condition appropriate to that page instead. Check the screenshot at the viewport and state that matter; one image cannot establish accessibility-tree behavior, so test assistive technology separately.
Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server for developers. A single GET request can return a screenshot as PNG, JPEG, or WebP, or a PDF. Example cURL request:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
See the ScreenshotNeo API documentation for request options. It accepts cookie or consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each of those steps can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The free plan includes 1,000 shots a month without a card; paid plans start at $5 for 3,000 shots.
Sign up for ScreenshotNeo free to get 1,000 screenshots a month with no card.
Troubleshoot common display issues
- A flex or grid container behaves like a block: This is expected for
flexandgrid; their default outer type is block. Useinline-flexorinline-gridif the container should participate inline. - An inline element does not behave like a box in the way you expect: Check whether you need
inline-blockto keep inline participation while using block formatting behavior inside. - Floated children extend beyond the apparent container: Apply
display: flow-rootto the container to establish a block formatting context that contains internal floats. - Hidden content still leaves a gap:
visibilityretains layout space. Usedisplay: nonewhen the element and its descendants should not participate in layout. - Content remains after applying
display: contents: That is expected: the element’s own box is removed, but its child boxes remain. - A table’s screen-reader behavior changes after a display override: Restore semantic table markup and test the target browser and assistive technology; CSS display changes can affect accessibility-tree representation in some browsers.
- A newer or unusual display value has no effect in a target browser: Check compatibility for that specific value and provide a fallback that suits your supported browser matrix.
Frequently Asked Questions
Does display: flex make the element itself inline?
No. flex uses a block-level outer box and flex layout for its children; use inline-flex for an inline-level flex container.
Is inline-block the same as inline flex?
No. inline-block is equivalent to inline flow-root; inline flex lays out children with flexbox.
Does display: contents hide an element’s children?
No. It removes the element’s own box while child boxes remain in layout.
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.

