There must be a straightforward explanation for this perplexing issue. However, in my view, it ought to function as intended.
We are currently utilizing the Bootstrap 3 CSS framework. The following code is present on a specific page:
<div class="promotions-overview">
<div class="row promo-row">.. other contents ..</div>
<hr>
<div class="row promo-row">.. other contents ..</div>
<hr>
<div class="row promo-row">.. other contents ..</div>
<hr>
</div>
Upon applying .promo-row:nth-child(odd)
to style the odd promo-rows with a grayish background color, all promo-rows end up being styled. Interestingly, when I eliminate the <hr>
elements, the CSS is correctly applied.
I may be mistaken, but given that I am using the class .promo-row
in the CSS selector, it should only target these elements to determine if they are odd rows or not. Why are the <hr>
elements being perceived as elements with the same class?