::grammar-error and ::spelling-error - Pseudo-elements CSS.
Summary of characteristics of the ::grammar-error selector
Description of pseudo-elements ::grammar-error and ::spelling-error.
These two pseudo-elements target words or parts of texts that contain mistakes:
::spelling-erroridentifies spelling mistakes,::grammar-errorIdentifies grammar mistakes.
But at the moment (2025) still doesn't recognize the pseudo-element ::grammar-error.
Spell or grammar checking can be disabled with the HTML spellcheck="false" attribute, also inoperative are the pseudo-elements
::grammar-error and ::spelling-error.
A limited number of properties can apply to these selectors:
- Foreground and background colors:
color,background-color. - The cursor properties:
cursorandcaret-color. - The frame:
outlineand detailed properties. - Text decoration:
text-decorationand detailed properties. - The emphasis color:
text-outline-color. - Text shading:
text-shadow.
Example.
Spelling and grammar checks are performed when the input box is active: click on the text below.
You are free to add or correct mistakes to observe the behavior of your browser.
You may be required to install the grammar checker.
Browers compatibility.
Support for the ::grammar-error and ::spelling-error pseudo-classes is still imperfect, especially on
the browser, which is widely used.
::grammar-error to target grammar mistakes in a text.::spelling-error which targets spelling mistakes contained in the text.::grammar-errorpseudo-class
::spelling-errorpseudo-class
Browsers on computers :
Mobile browsers :
Outdated or marginal browsers :

Internet Explorer

UC Browser pour Androïd

Opéra Mobile

QQ Browser

Baidu Browser

Opéra

Samsung Internet

Firefox pour Androïd

Chrome

Edge

Firefox

Chrome pour Androïd

Androïd Brower

Safari sur IOS

Safari

KaiOS Browser

Opéra mini
::grammar-error and ::spelling-error pseudo-elements history.
-
CSS Pseudo-Elements Module Level 4
Introducing the::grammar-errorand::spelling-errorpseudo-elements.January 15, 2015Working Draft.
Other pseudo-elements.
Recall that pseudo-elements are selectors that target elements that are not delimited by tags, unlike classes that target items that are in a given state. Many pseudo-elements are defined in the CSS Pseudo-Elements Module standardization module. Here is the list:
Selectors:




placeholder attribute).





