Elements Panel: DOM Inspection, CSS Styles, and Layout Overlays
How to inspect and edit the DOM, debug CSS in Styles and Computed, use badges and overlays for grid and flex, and read the accessibility tree in Chrome DevTools.
This page summarises Chrome DevTools documentation on the Elements panel—the place you open when you need to see HTML as the browser builds it, change CSS live, or understand why layout or accessibility does not match what you expect.
Elements panel: what it is and how you open it
Section titled “Elements panel: what it is and how you open it”The Elements panel is DevTools’ interface to inspect and change the DOM. The DOM tree looks like an HTML document; you select nodes there and work with the tabs beside it.
The Elements panel provides a robust interface to inspect and manipulate the DOM. You can use the DOM tree, which resembles an HTML document, to select specific DOM nodes and modify them with other tools.
— Google, Elements panel overview
To open the Elements panel and inspect an element, right-click a node on the page and choose Inspect. DevTools opens Elements and selects that node in the tree; the Styles tab shows rules applied to it.
The panel also includes Styles, Computed, Layout, Event listeners, DOM breakpoints, Properties, and Accessibility—each narrower than the DOM tree itself (Elements panel overview).
Select an element when Inspect is not enough
Section titled “Select an element when Inspect is not enough”The CSS features reference lists other ways to select a node:
- Right-click in the viewport → Inspect
- Select an element (or
Command+Shift+C/Control+Shift+C), then click on the page - Click a node in the DOM tree
- In the Console, run something like
document.querySelector('p'), right-click the result → Reveal in Elements panel
Inspecting a node is also the first step toward viewing and changing its CSS, as described in Get started with viewing and changing the DOM.
DOM tree: navigate, search, and edit HTML on the fly
Section titled “DOM tree: navigate, search, and edit HTML on the fly”The DOM Tree in Elements is where DOM work happens. After Inspect, you can move with the keyboard (Up/Down/Left/Right to collapse, expand, and change parents), use Scroll into view when a node is off-screen, or press Control+F / Command+F to search by string, CSS selector, or XPath.
You can edit the DOM live: double-click text to change content, double-click attributes or use Edit as HTML for larger edits, drag nodes to reorder, press H to hide, Delete to remove (undo with Control+Z / Command+Z), and use Force state for pseudo-states like :hover.
The Console ties in: the selected node is $0. Right-click a node → Store as global variable or Copy → Copy JS Path for tests and scripts.
Properties tab: object fields behind a node
Section titled “Properties tab: object fields behind a node”For JavaScript-facing detail, open Properties: select a node, then the Properties tab (under More if needed). Own properties appear in bold; inherited ones in regular font. Expand [[Prototype]] chains to find where an inherited value comes from. Linked properties jump back to the relevant DOM node.
Styles tab vs Computed tab: declared rules vs what actually paints
Section titled “Styles tab vs Computed tab: declared rules vs what actually paints”The Elements panel splits “what you wrote” from “what the browser uses.”
| Pane | Best for | What it shows |
|---|---|---|
| Styles | Editing, cascade, dead rules | Rules from all stylesheets, including overridden declarations |
| Computed | Final used values, inheritance | Resolved properties Chrome uses to render the element |
The Elements > Styles pane displays the exact set of CSS rules as they are written in various stylesheets. On the other hand, the Elements > Computed pane lists resolved CSS values that Chrome uses to render an element: CSS derived from inheritance, cascade winners, longhand properties (precise), not shorthand (concise), computed values, for example, font-size: 14px instead of font-size: 70%.
Use Styles to add or tweak rules (View and change CSS): inline declarations in element.style, new rules via New Style Rule, classes via .cls, pseudo-states via :hov, and the box model via Show sidebar. Prefer inline declarations when you need a change to win quickly—they beat most external rules on specificity (CSS reference).
When overrides confuse you, open Computed and optionally Show All / Group (CSS reference). Jump from a computed property back to its winning rule with the arrow control or the stylesheet link.
Tooltips in Styles explain properties (from VS Code Custom Data), selector specificity, and custom property values—toggle under Settings → Preferences → Elements → Show CSS documentation tooltip (Preferences).
Find invalid, overridden, inactive, and other CSS
Section titled “Find invalid, overridden, inactive, and other CSS”If new CSS “does nothing,” inspect the Styles pane before guessing at bugs.
- Matched vs unmatched selectors — unmatched appear in pale text
- Invalid — unknown properties or bad values; crossed out with warning icons
- Overridden — crossed out because another declaration won the cascade (e.g. inline
widthbeating a class) - Inactive — valid but has no effect (e.g.
justify-contenton a non-flex element); pale text with an information icon—hover for hints - Inherited vs non-inherited — Inherited from … sections; pale without icons means “not inherited by default,” not “inactive”
- Shorthand — expand dropdowns to see which longhands are overridden
- Non-editable — italic (e.g. user agent stylesheet, some attribute-derived styles)
Lighthouse image aspect-ratio guidance points here: when CSS distorts an image, Computed shows what actually applies.
Badges and Layout: grid, flex, container, and top layer
Section titled “Badges and Layout: grid, flex, container, and top layer”Badges in the DOM tree mark special layout or component behaviour. Right-click a node → Badge settings to show or hide badge types.
| Badge | Element condition | What clicking does |
|---|---|---|
| grid / subgrid | display: grid / inline-grid, or subgrid tracks |
Toggles grid overlay (lines, tracks, gaps) |
| flex | display: flex / inline-flex |
Toggles flex overlay |
| container | container-type set |
Toggles container query overlay |
| scroll / scroll-snap | Scroll containers / snap | Scroll-related overlays |
| top-layer / popover | <dialog> in top layer, popover attribute |
Links to #top-layer container after </html> |
| slot / custom-element | Shadow DOM slots, custom tags | Navigate slot ↔ content or jump to Sources |
For deeper grid and flex work, see Inspect CSS grid and Inspect and debug CSS flexbox layouts: Layout lists all flex/grid containers, toggles overlays, and can recolour them. The Grid Editor and flexbox editor buttons beside display: grid / display: flex set alignment without typing longhand properties.
@container rules appear in Styles when a query matches; the container name above the rule links to the querying element. Edit thresholds in place to test breakpoints.
Accessibility tab: tree, source order, computed a11y props
Section titled “Accessibility tab: tree, source order, computed a11y props”The Accessibility features reference lives under Elements → Accessibility.
The Accessibility tab is where you can view the accessibility tree, ARIA attributes, and computed accessibility properties of DOM nodes.
— Google, Accessibility features reference
Turn on Show accessibility tree to replace the DOM tree with the full-page tree exposed to assistive tech—it is a subset of the DOM with only relevant nodes. Toggle back to keep the same DOM selection.
Source Order Viewer outlines elements in viewport order with numbers when visual order differs from DOM order—important for screen reader and keyboard order bugs.
Computed (accessibility) properties show values the browser derives dynamically (not the same as the CSS Computed tab).
To see name, role, contrast, and focusability without opening the tab, use Inspect mode: hover shows dimensions, colours, fonts, grid/flex icons, accessibility name/role, focusability, and heading contrast ratios.
Track focus that disappears on the page with a Console Live Expression for document.activeElement, then Open in Elements panel from the result.
Inspect mode, Rendering tricks, and page-level CSS reports
Section titled “Inspect mode, Rendering tricks, and page-level CSS reports”Inspect mode (element picker) highlights nodes as you hover and syncs the DOM tree. Hold Ctrl+Alt (or Ctrl+Option on Mac) to pin the tooltip; hold Ctrl to hide it temporarily. Elements with pointer-events: none need Shift while hovering.
Focus-sensitive UI (menus, date pickers) often vanishes when DevTools steals focus. Enable Emulate a focused page on the Rendering tab or under :hov in Styles. Chrome documents a caveat:
Caution: With this option turned on, the document.visibilityState is set to visible and the visibilitychange event doesn’t fire.
— Google, Apply other effects
For unused CSS at file level, use the Coverage tab (Command Menu → “Show Coverage”) after reload. The CSS Overview panel reports colours (including low contrast), fonts, unused declarations, and media queries across the page.
Common mistakes
Section titled “Common mistakes”- Treating pale Styles text as one problem—inactive (icon), non-inherited (no icon), and unmatched selectors look similar but mean different things (CSS issues).
- Editing only in Computed—many values are read-only summaries; change declarations in Styles or the DOM.
- Ignoring badges when debugging layout—overlays show tracks and flex lines faster than reading every declaration.
- Assuming DOM order equals reading order—use Source Order Viewer when tab order or screen reader order looks wrong.
How to check this on your site
Section titled “How to check this on your site”- Open your page in Chrome, right-click the element you care about, and choose Inspect (Open DevTools).
- In Styles, confirm your selector is matched (not pale) and not crossed out as overridden or invalid (CSS issues).
- Open Computed, enable Show All if needed, and verify the property values match what you see on screen (CSS reference).
- For layout, enable the relevant grid, flex, or container badge or use the Layout pane (Badges reference).
- You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact sentence you are asking about.