Limited supportLimited browser support. Check compatibility before use.

Overview

The ::spelling-error and ::grammar-error CSS pseudo-elements match text that is highlighted as misspelled and grammatically incorrect, respectively.

Browser support

Feature Desktop Mobile
Chrome
Edge
Firefox
Safari
Chrome Android
Safari iOS
121
121
17.4
121
17.4
Other

`::spelling-error`

121
121
17.4
121
17.4
1+Supported (version) Not supported Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)

Syntax

CSS
::spelling-error {
  text-decoration: wavy underline red;
}
::grammar-error {
  text-decoration: wavy underline green;
}

Live demo

spellerrordecoration

CSS spellerrordecoration demo.

PreviewFullscreen

text methoderrordecoration

CSS text methoderrordecoration demo.

PreviewFullscreen

both. combination

CSS both. combination demo.

PreviewFullscreen

Use cases

  • Using ::spelling-error and ::grammar-error

    The ::spelling-error and ::grammar-error CSS pseudo-elements match text that is highlighted as misspelled and grammatically incorrect, respectively.

Cautions

  • Limited browser support. Check compatibility before use.

Accessibility

  • Make sure visual changes are conveyed appropriately to assistive technology.

Powered by web-features