问题描述
有没有一种 CSS 方法可以按类选择看起来像这样的元素?
Is there a CSS way to select an element that looks like that by class?
<a class="" href="...">
类似于空类声明的选择器?
Like a selector for empty class declarations?
推荐答案
你可以在这里使用元素属性选择器,类值为空
You can use element-attribute selector here with an empty class value
div[class=""] { color: red; }
演示
注意:您可以将 div 替换为所需元素
Note: You can replace the div with required element