I attempted to utilize the :nth-child selector to target the first, third, and fifth elements with the class name "personal", but it did not work as expected. Is there an alternative method to specifically select these elements sharing the same class? I have exhausted several approaches without success and would greatly appreciate any guidance or solution. Thank you.
.personal:nth-child(1) {
border:5px solid red;
width:100%;
display:block;
}
.personal:nth-child(3) {
border:5px solid red;
width:100%;
display:block;
}
.personal:nth-child(7) {
border:5px solid red;
width:100%;
display:block;
}
<div class="wrapper" id="content">
<div class="title" style="font-size: 15px">Client info:</div>
<div class="personal" style="font-size: 18px"><span>First name:</span><span>Paul</span></div>
<div class="personal" style="font-size: 18px"><span>Last name:</span><span>Lee</span></div>
<div class="personal" style="font-size: 12px"><span>Phone:</span><span>+61 7 3658 5544</span></div>
<div class="instruction"><span><span class="data-img icon-important"></span></span><span class="comment" style="font-size: 12px">I don't require plastic cutlery.</span></div>
<div class="title" style="font-size: 15px">Items:</div>
<div>
<div class="item" style="font-size: 18px">
<div class="d-flex">
<div class="quantity">2x</div>
<div>Pizza Prosciutto</div>
</div>
<div>11.60</div>
</div>
<div class="instruction-small"><span class="center-horizontally"><span class="data-img icon-important"></span></span><span class="comment-small" style="font-size: 15px">No mushrooms, please!</span></div>
</div>
<div class="dotted-line taxes-total-separator"></div>
<div class="personal" style="font-size: 15px"><span>Sub-total:</span><span>A$20.60</span></div>
<div class="total" style="font-size: 15px"><span>Total in AUD:</span><span>A$20.60</span></div>
<div class="title" style="font-size: 15px">Order details:</div>
<div class="personal" style="font-size: 12px"><span>Number:</span><span>1</span></div>
<div class="personal" style="font-size: 12px"><span>Placed at:</span><span>25 February, 2:12 am</span></div>
<div class="personal" style="font-size: 12px"><span>Accepted at:</span><span>25 February, 2:13 am</span></div>
<div class="personal" style="font-size: 18px"><span>Fulfillment at:</span><span>25 February, 3:13 am</span></div>
</div>