CSS3 样式属性中的布尔值

发布于 2024-12-26 02:08:09 字数 342 浏览 1 评论 0原文

在 CSS3 中,是否有任何属性采用 falsenull 值?我想并期望不会,但想确定一下。

我正在编写一段 javascript 代码(与 ajax 交互相关),用于设置或删除某个 DOM 对象的属性。该函数采用属性名称及其值作为参数,我想,如果该值结果为 falsenull,则 removeAttribute( ) 函数应该被调用,否则,应该为该属性分配该值。如果有一个样式属性可能采用 falsenull 值,那么我不能这样做,所以我想确定一下。

In CSS3, is there any attribute that takes false or null value? I suppose and expect not, but wanted to make sure.

I am writing a javascript code (related to ajax interaction) that sets or removes an attribute to/from some DOM object. The function takes an attribute name and its value as the arguments, and I am thinking that, if the value turns out to be false or null, then removeAttribute() function should be called, and otherwise, the attribute should be assigned with that value. If there is a style attribute that possibly takes false or null value, then I cannot do that, so I wanted to make sure.

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

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

发布评论

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

评论(2

寂寞陪衬 2025-01-02 02:08:09

不,没有任何属性采用 falsenull。但是,我非常确定您可以在没有任何视觉影响的情况下创建您的财产。

No, there is no attribute that takes false or null. However, I am pretty sure you can create your property without any visual impact.

ペ泪落弦音 2025-01-02 02:08:09

不会。即使像 speak-header 这样的内容也只有两个可能的值仍然可以接受特殊值inherit

No. Even ones like speak-header which have only two possible values can still accept the special value inherit.

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