::spelling-error
::spelling-error CSS 伪元素表示一个被用户代理标记为拼写错误的文本片段。
::spelling-error 伪元素遵循所有高亮伪元素共有的特殊继承模型。有关此继承如何工作的更多详细信息,请参阅高亮伪元素继承部分。
允许的属性
在选择器中包含 ::spelling-error 的规则中,只能使用 CSS 属性的一小部分
语法
css
::spelling-error {
/* ... */
}
示例
基本文档拼写检查
在此示例中,最终支持的浏览器应使用所示样式突出显示任何标记的拼写错误。
HTML
html
<p contenteditable spellcheck="true">
My friends are coegdfgfddffbgning to the party tonight.
</p>
CSS
css
::spelling-error {
text-decoration: wavy red underline;
}
结果
规范
| 规范 |
|---|
| CSS 伪元素模块 Level 4 # 选择器定义-拼写错误 |
浏览器兼容性
加载中…