Select an element with empty class attribute (class=quot;quot;) using CSS?(使用CSS选择具有空类属性(class =“)的元素?)
问题描述
有没有一种 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选择具有空类属性(class =“")的元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用CSS选择具有空类属性(class =“")的元素?


基础教程推荐
- npm start 错误与 create-react-app 2022-01-01
- 原生拖动事件后如何获取 mouseup 事件? 2022-01-01
- Bootstrap 模态出现在背景下 2022-01-01
- Bokeh Div文本对齐 2022-01-01
- 如何添加到目前为止的天数? 2022-01-01
- 在 contenteditable 中精确拖放 2022-01-01
- 即使用户允许,Gmail 也会隐藏外部电子邮件图片 2022-01-01
- 检查 HTML5 拖放文件类型 2022-01-01
- Fabric JS绘制具有活动形状的多边形 2022-01-01
- fetch 是否支持原生多文件上传? 2022-01-01