# inert attribute

Status: Baseline 2023 (Chrome 102, Safari 15.5, Firefox 112); widely available.  
Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inert  
Page: https://designforai.dev/css/inert-attribute

Removes a subtree from focus, clicks and the accessibility tree in one attribute. Use it for off-canvas panels, disabled steps in a wizard, or content behind a custom overlay.

## HTML

```html
<section class="fx-015">
  <div inert class="fx-015-step"><h4>Step 1 (done)</h4><button>Edit</button></div>
  <div class="fx-015-step"><h4>Step 2</h4><button>Continue</button></div>
</section>
```

## CSS

```css
.fx-015 {
  display: grid;
  gap: 12px;
  font-family: system-ui
}
.fx-015-step {
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px
}
.fx-015-step[inert] {
  opacity: .5;
  filter: grayscale(1)
}
.fx-015 :is(a,button,input,select,textarea):focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
```

Fallback: All evergreen browsers support it; older ones would leave the content focusable, so also set `aria-hidden` if you target them.

## Prompt

Use the `inert` attribute (not `tabindex=-1` loops or `pointer-events:none`) to disable whole regions: closed drawers, inactive wizard steps, page content behind a non-native overlay. Style `[inert]` visually so users can see it is unavailable, and remove the attribute when the region becomes active again.
