I am using a CSS library that relies on Less. In order to override the CSS properties of a certain element I am trying to use the higher degree of specificity technique by wrapping a parent element "commentPaddingFix" as so:
<div class='commentPaddingFix'>
<div class='Child1'>
<div class='Child2'>
<div class='ant-comment-inner'>
</div>
</div>
</div>
</div>
And in the Less file:
.commentPaddingFix {
.ant-comment-inner {
padding-bottom: 0px !important;
padding-top: 0px !important;
}
}
I need a solution that works when you know the className of the element you are targeting for any arbitrary number of nested parent elements. I can't use nth child technique as the children numbers vary from render to render.