只有当这个 div 类可用时,我才必须在 CSS 下应用
dhx_list_item dhx_list_day_events_item
.dhx_view .day_events .dhx_scroll_cont:first-of-type:before {
//some code here
}
请查收附件。
最佳答案
使用 jquery,你可以尝试这样的事情:
if ($('#child').length) {
// manipulate the parent
$('#parent').addClass('dhx_view');
}
如果没有子 div
存在,$('#child').length
将评估为 false
。
关于html - 如何将 css 属性添加到基于另一个子 div 类的 div 类?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23558606/