Overview Open Chrome DevTools What's New in DevTools DevTools tips Simulate mobile devices with Device Mode Performance insights: Get actionable insights on your website's performance Lighthouse: Optimize website speed Animations: Inspect and modify CSS animation effects Changes: Track your HTML, CSS, and JavaScript changes Coverage: Find unused JavaScript and CSS CSS Overview: Identify potential CSS improvements Issues: Find and fix problems Media: View and debug media players information Memory Inspector: Inspect ArrayBuffer, TypedArray, DataView, and Wasm Memory. Network conditions: Override the user agent string Security: Understand security issues Search: Find text across all loaded resources Sensors: Emulate device sensors WebAuthn: Emulate authenticators Customize DevTools Engineering blog
Overview Open Chrome DevTools What's New in DevTools DevTools tips Simulate mobile devices with Device Mode Performance insights: Get actionable insights on your website's performance Lighthouse: Optimize website speed Animations: Inspect and modify CSS animation effects Changes: Track your HTML, CSS, and JavaScript changes Coverage: Find unused JavaScript and CSS CSS Overview: Identify potential CSS improvements Issues: Find and fix problems Media: View and debug media players information Memory Inspector: Inspect ArrayBuffer, TypedArray, DataView, and Wasm Memory. Network conditions: Override the user agent string Security: Understand security issues Search: Find text across all loaded resources Sensors: Emulate device sensors WebAuthn: Emulate authenticators Customize DevTools Engineering blog

Badges reference

Published on

Toggle various overlays and speed up DOM tree navigation with this comprehensive reference of badges in the Elements panel.

Show or hide badges

To show or hide badges:

  1. Open DevTools.
  2. Right-click an element in the DOM tree and select Badge settings.... Badge settings.
  3. Select or clear checkboxes next to the desired badges.

The Elements panel shows the selected badges next to the appropriate elements in the DOM tree. The next sections explain every badge.

Grid

An HTML element is a grid container if its display CSS property is set to grid or inline-grid. Such elements have grid badges next to them that toggle the corresponding overlays.

Toggle the overlay on the following preview:

  1. Inspect the element in the preview.
  2. In the DOM tree, click the grid badge next to the element and observe the overlay.
Grid overlay.

The overlay shows columns, rows, their numbers, and gaps.

To learn how to debug grid layout, see Inspect CSS grid.

Flex

An HTML element is a flex container if its display CSS property is set to flex or inline-flex. Such elements have flex badges next to them that toggle the corresponding overlays.

Toggle the overlay on the following preview:

  1. Inspect the element in the preview.
  2. In the DOM tree, click the flex badge next to the element and observe the overlay.
Flex overlay.

The overlay shows child element positions.

To learn how to debug flex layouts, see Inspect and debug CSS flexbox.

DevTools can detect some ad frames and tag them. Such frames have ad badges next to them.

Discover an ad in the following preview:

  1. Inspect the element in the preview.
  2. In the DOM tree, find an element with the ad badge next to it.
Ad badge.

The ad badge is not clickable but you can use the Rendering tab to highlight ad frames in red.

Scroll-snap

An HTML element is a scroll container if its overflow CSS property is set to scroll, or auto when there's enough content to cause overflow. Scroll containers can have CSS properties that configure snap points. Such elements have scroll-snap badges next to them that toggle the corresponding overlays.

Toggle the overlay on the following preview:

  1. Inspect the element in the preview.
  2. In the DOM tree, click the scroll-snap badge next to the element.
  3. Try scrolling the element to the right and observe the overlay.
Scroll-snap overlay.

The overlay shows element positions and snap points.

Container

An HTML element is a container if it has the container-type CSS property. Such elements have container badges next to them that toggle the corresponding overlays.

CSS container queries is an experimental feature. To enable its support in DevTools, under chrome://flags, set the Enable CSS Container Queries experiment to Enabled. Otherwise, the preview below doesn't work.

Toggle the overlay on the following preview:

  1. Inspect the element in the preview.
  2. In the DOM tree, click the container badge next to the element.
  3. Try resizing the element by dragging its bottom-right corner and observe the layout change and overlay.
Container overlay.

The overlay shows child element positions.

To learn how to debug container queries, see Inspect and debug CSS container queries.

Slot

The <slot> HTML element is a placeholder that you can fill with your own content. Together with the <template> element, <slot> lets you create separate DOM trees and present them together. Slot content elements have Slot.slot badges next to them that serve as links to the corresponding slots.

The slot badge is a new DevTools feature available from Chrome version 104. In earlier versions, the preview below doesn't work.

Discover the Slot.slot badge in the following preview:

  1. Inspect the element in the preview.

  2. In the DOM tree, click the Slot.slot badge next to the element to locate the corresponding slot. Slot and reveal badges.

    Important

    The Slot.slot badge has a paired Reveal.reveal badge that takes you back.

  3. Get back to the slot's content by clicking the Reveal.reveal badge.

Top layer

This badge helps you understand the concept of the top layer and visualize it. The top layer renders content on top of all other layers, regardless of z-index. When you open a <dialog> element using the .showModal() method, the browser puts it into the top layer.

To help you visualize top layer elements, the Elements panel adds a #top-layer container to the DOM tree after the closing </html> tag.

Top layer elements have Link.top-layer (N) badges next to them, where N is the element's index number. The badges are links to the corresponding elements in the #top-layer container.

This feature is available from Chrome version 105. In earlier versions, the preview below doesn't work.

Discover the Link.top-layer (N) badge in the following preview:

  1. In the preview, click Open dialog.

  2. Inspect the dialog.

  3. In the DOM tree, click the Link.top-layer (1) badge next to the <dialog> element. The Elements panel takes you to the corresponding element in the #top-layer container after the closing </html> tag. The top-layer container and badge.

    Important

    The Link.top-layer (N) badge has a paired Reveal.reveal badge that takes you back.

  4. Get back to the <dialog> element by clicking the Reveal.reveal badge next to the element or its ::backdrop.

Updated on Improve article

We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.