Reputation: 41
HTML:
<div class="offer-section">
<div class="divider"></div>
</div>
<div class="offer-section">
<div class="divider"></div>
</div>
<div class="offer-section">
<div class="divider"></div>
</div>
<div class="offer-section">
<div class="divider"></div>
</div>
CSS:
.offer-section{
.divider { border: solid 1px #bdbdc3; height: 2px; margin-top: 5%; }
}
.offer-section:last-child {
.divider { }
}
Trying to add a divider to the bottom of every offer-section div except the last one. However the code above does not seem to be able to do the job. Would appreciate any help :)
Upvotes: 0
Views: 58
Reputation: 1
.offer-section .divider {
border: solid 1px #bdbdc3; height: 20px; margin-top: 5%;
}
.offer-section:nth-child(4) .divider{
border-bottom: none;
}
Upvotes: 0
Reputation: 519
You need to provide proper CSS properties as per the requirement, as given below.
.offer-section{
.divider { border: solid 1px #bdbdc3; height: 2px; margin-top: 5%; }
}
.offer-section:last-child {
.divider { border: none; }
}
Upvotes: 1