Looking to adjust padding based on specific child class
<div class="container page-content">
</div>
The page-content class typically includes padding:
.container.page-content{
padding-top: 160px;
}
However, there is a special case where an "item-pagehome" class is present inside the div:
<div class="container page-content">
<div class="item-pagehome">
Some Content ...
</div>
</div>
In this scenario, I want to disable the padding-top from .page-content. But how can I achieve this?
I attempted to select it using:
.page-content:has(> .item-pagehome){
padding-top: 0px;
}
Unfortunately, this approach did not work...
Is there a way to target a div only when it contains a specific child class, like .item-pagehome in this situation?