有没有办法隐藏 Google Chrome 和 Google Chrome 中显示的新 HTML5 spinbox 控件?歌剧?

发布于 2024-09-15 17:17:21 字数 280 浏览 0 评论 0原文

现在的 Google Chrome 和之前的 Opera 都会在“数字”类型的输入字段旁边显示一个“旋转框”控件。我希望能够设计它的样式,或者隐藏它。有没有办法控制这个 UI 元素?

例如: alt text <-- 带有向上和向下箭头的小 ui 元素。它不是那么实用,并且它向我创建的表单添加了不需要的元素。

我知道我不能将类型设置为“数字”,但它允许内置防止输入数字以外的任何内容,并且在语义上是正确的。

Google Chrome now, and Opera before, shows a "spin box" control beside a input field of type "number". I want to be able to style this, or hide it. Are there ways of controlling this UI element yet?

EG:
alt text <-- That little ui element with an up and down arrow. It's not that functional and its adding unnedded elements to a form I've created.

I understand I can just not have the type as "number" but it allows built in prevention of entering anything other than a number, and is semantically correct.

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

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

发布评论

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

评论(1

梦明 2024-09-22 17:17:21

目前,据我所知,答案是否定的。

HTML5 规范通常不想规定用户界面应该是什么样子,这也适用于输入类型=数字功能。我认为有一种隐含的预期工作流程,有点像

来自作者/浏览器供应商/有趣的人的输入> HTML 规范中的规范文本 >实现(用 UI 进行实验)> UI 约定(尝试样式)> CSS提案>有关如何设置新控件样式的 CSS 规范。

因此,在不久的将来不可能真正控制新输入的渲染。当然,浏览器可能同时实现实验性的特定于供应商的 CSS 扩展。

At the moment, the answer is no - as far as I know anyway.

The HTML5 spec generally doesn't want to dictate what the user interface should look like, this also applies to the input type=number feature. I think there is a sort of implicitly expected workflow which goes somewhat like

input from authors/browser vendors/interesting people > spec text in HTML spec > implementations (experimenting with UI) > UI conventions (experimenting with styling) > CSS proposals > CSS spec for how to style the new controls.

Hence, real control over the rendering of the new inputs won't be possible in the near future. Of course, browsers may meanwhile implement experimental vendor-specific CSS extensions..

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