通过 HTML/css 关闭 Chrome/Safari 拼写检查

发布于 2024-10-08 18:05:10 字数 228 浏览 1 评论 0 原文

有没有办法让 Web 开发人员关闭 Chrome/Safari/WebKit 对特定 inputtextarea 元素的拼写检查?我的意思是通过特殊标签属性或专有 CSS 指令。

有一个 CSS 指令用于关闭输入的大纲,所以我认为这也可能存在。我知道用户如何做到这一点。

或者,作为用户,我可以针对某些特定域禁用它吗?

Is there a way for a web developer to turn off Chrome/Safari/WebKit's spellchecking on particular input or textarea elements? I mean either by special tag attribute or a proprietary CSS instruction.

There is a CSS instruction for turning off outlining of inputs so I thought that might also exist. I know how a user can do it.

Or, as a user, can I disable it for some particular domain?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

如果没有 2024-10-15 18:05:10

是的,有 HTML5 拼写检查属性。

http://www.whatwg.org/specs/web-apps /current-work/multipage/editing.html#spelling-and-grammar-checking

更新:现在所有浏览器的最新版本都支持此功能。

Yes, there is the HTML5 spellcheck attribute.

<textarea spellcheck="false"> or <input type="text" spellcheck="false">

http://www.whatwg.org/specs/web-apps/current-work/multipage/editing.html#spelling-and-grammar-checking

Update: This is now supported in the latest versions of all browsers.

坠似风落 2024-10-15 18:05:10

这适用于 Safari 7.1,也应该适用于其他版本:

<input autocomplete="off" autocorrect="off" autocapitalize="off" 
spellcheck="false"/>

只有 spellcheck="false" 不起作用。

This works in Safari 7.1 and should work also in others:

<input autocomplete="off" autocorrect="off" autocapitalize="off" 
spellcheck="false"/>

Only spellcheck="false" didn't work.

讽刺将军 2024-10-15 18:05:10

对于表单的所有元素都是可能的,因此:

<form spellcheck="false" .. />

for all elements of a form it is possible and so:

<form spellcheck="false" .. />
∞觅青森が 2024-10-15 18:05:10

在 React 中,你必须使用 spellCheck 来代替。

<input spellCheck={false} type="text"/>

In React, you gotta use spellCheck instead.

<input spellCheck={false} type="text"/>
半仙 2024-10-15 18:05:10

关于输入标签的概述:不要这样做,这是给用户的视觉提示。

但如果你必须:

#your-input{outline:none;}

Regarding outlining of input tags: don't do it, it's a visual cue for users.

But if you must:

#your-input{outline:none;}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文