css - CSS在一个类中选择一个类中的所有元素
问题描述
我正在使用 CMS(Joomla),它们允许我为标签放置一个类,然后我可以修改该特定页面的 css。
我正在尝试使用MDN来找到答案,但我无法完全按照我想要的方式工作。
这是他们页面上的 JSFiddle,我在搞乱它: https ://jsfiddle.net/amvz5dkb/13/
<div class="divclass">
<span class="spanclass">Span #1, in the div.
<span="betterspanclass">Span #2, in the span that's in the div.</span>
<span="betterspanclass">Span #3, in the span 1.</span>
</span>
</div>
<span>Span #4, not in the div at all.</span>
这是我的 CSS
.divclass > .betterspanclass {
background-color: red;
}
这个不行,只能
.divclass > span {
background-color: red;
}
似乎有效果,但它根本不影响跨度3,只影响跨度1和跨度2。我想为divclass中的每个betterspanclass设置背景红色。这可能吗?
解决方案
推荐阅读
- quartz.net - 具有多个微服务的 Quartz 集群
- python-3.x - 预训练模型中的大文本问题 - t5-large
- dhcp - 发送发现数据包而不释放是否正确?
- flutter - 如何从博世激光测量蓝牙设备接收数据使用颤振
- python - 有没有办法只从 OSM 下载车辆网络作为 .osm 文件?
- c# - 开源Unity拦截,策略注入如何拦截几种类型
- c# - 在 DataTable 速度优化 WPF DataGrid 中查找和编辑行
- sql - 我怎样才能从历史表中得到一个间隙来随着时间的推移重复组
- oracle - 需要说明 Oracle LiveSQL 中的错误
- algorithm - 真值为1101的逻辑门