I have multiple div container "footer-ad-button". Some of these are in a div container called "platinum" others in "gold". The following CSS code behaves pretty weird to me. If i have both ads active, platinum and gold, the "margin-bottom: 0" works only for the last gold ad, but not for the last platinum ad. If i deactivate all gold ads, it works for the last platinum ad.
Conclusion: Somehow this code works only for one of both last-of-type css rules (depends on which html is active), but i don't see any reason why it behaves like this.
CSS:
.ad .footer-ad-button{
margin-bottom: 20px;
}
.ad > div > .platinum:last-of-type > .footer-ad-button,
.ad > div > .gold:last-of-type > .footer-ad-button{
margin-bottom: 0;
}
HTML:
<div class="ad">
<div class="row">
<div class="platinum">
<div aria-label="Advertisement" class="footer-ad-button" onclick="location.href = '/'">
<div class="advertise-inner"></div>
</div>
</div>
<div class="platinum">
<div aria-label="Advertisement" class="footer-ad-button" onclick="location.href = '/'">
<div class="advertise-inner"></div>
</div>
</div>
<div class="gold">
<div aria-label="Advertisement" class="footer-ad-button" onclick="location.href = '/'">
<div class="advertise-inner"></div>
</div>
</div>
<div class="gold">
<div aria-label="Advertisement" class="footer-ad-button" onclick="location.href = '/'">
<div class="advertise-inner"></div>
</div>
</div>
</div>
</div>