本文介绍了使用CSS选择具有空类属性(类=“”)的元素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有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
这篇关于使用CSS选择具有空类属性(类=“”)的元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!