CSS attribute selector for non-empty attributes

后端 未结 1 349
南旧
南旧 2020-12-14 05:11

Is there a CSS selector that applies to non-empty attributes? Using :not([Data-Attribute=\'\']) matches if the attribute is non-existing, too.

相关标签:
1条回答
  • 2020-12-14 05:51

    try this

    <style>
        [Data-Attribute]:not([Data-Attribute=""])
        {
            background-color: Red;
        }
    </style>
    
    0 讨论(0)
提交回复
热议问题