I have below html structure, I want to apply border css to all elements with class name flw__subform-instance except first one:
<div class="flw__subform__content-wrapper">
<div class="flw__subform__header"></div>
<div class="flw__subform-instance">1</div> <!--exclude this bc 1st element -->
<div class="flw__subform-instance">2</div>
<div class="flw__subform-instance">3</div>
</div>
I have tried below code but its not working:
.flw__subform-instance{
padding: 20px;
border-top: 1em solid #ddd;
}
.flw__subform-instance:first-child {
padding: 20px;
}
3
Answers
Short and simple:
Reference: General sibling combinator
Try it:
You can use nth-child selector to reset the css of 1st element which is the second of the wrapper to solve your problem.