css - CSS 属性选择器匹配 void 值
问题描述
是否可以匹配具有没有值的属性的元素?
即:匹配这个:<element attribute>
。
不匹配这个:<element attribute="">
。<element attribute=" ">
, <element attribute="<any Unicode string>">
.
(不使用[attribute]:not([attribute^="a"i]):not([attribute^="b"i]):not([attribute^="<all remaining Unicode characters">)
。)
解决方案
没有办法用 CSS 来做到这一点,<element attribute>
就像<element attribute="">
.
您可以在规范中阅读此内容:https ://html.spec.whatwg.org/multipage/syntax.html#attributes-2
空属性语法:只是属性名称。该值隐含地是空字符串。
推荐阅读
- ios - 如何从 ARKit 人脸数据中测量人脸宽度?
- decision-tree - 决策树图中的值列表是什么意思
- r - 将 .adf 文件转换为 NetCDF
- excel - VBA Excel - 编译错误 - 预期的函数或变量
- python - psycopg2.OperationalError:无法将主机名“xxxxxx.us-east-1.rds.amazonaws.com”转换为地址:未知主机
- snowflake-cloud-data-platform - Snowflake - Java Script UDF 调用 Snowflake 外部函数
- google-sheets - 谷歌表格 - 跨数据表排序日期?
- wordpress - 如何在 REST API 中上传新媒体 - 带有 Post Man 的 WordPress
- python-3.x - “ TypeError: 'int' object is not callable” python3中的独特问题
- haskell - Haskell中的组匹配模式?