我有两个 dhx_scroll_cont div 类,当我编写 css 代码时,它适用于两个类。现在我想写一个申请第一个div调用的css代码
.dhx_scroll_cont:before{
//some code here
}
最佳答案
Demo Fiddle
只需使用:
.dhx_scroll_cont:first-of-type:before{
//some code here
}
The :first-of-type CSS pseudo-class represents the first sibling of its type in the list of children of its parent element.
更新
根据 the screenshot the OP posted以下应该有效:
.dhx_view_day_events .dhx_scroll_cont:first-of-type:before{
//some code here
}
关于html - 如何仅将 css 属性应用于我的第一个 div 类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23544173/