I want to add id or class to only the last item meta in the array in wc_display_item_meta.
Example:
<ul class="wc_item_meta">'
<li> <Strong class="wc_item_meta_label">Weight</strong> </li>
<li> <p> 24kg </p></li>
<li> <Strong class="wc_item_meta_label">Height</strong> </li>
<li> <p> 6 feet </p></li>
<li> <Strong class="wc_item_meta_label">Length</strong> </li>
<li> <p> 5 Meter </p></li>
</ul>
Here in this example i want the last item in array ie length in this example in bigger font than the other items in array.
Please Help!!
2
Answers
You can just add to it another class with
!important
inside to override the previous class.Also change the location of class,
strong
tag wont allow you to use width likeli
tag.You can select the last item i.e. 5 meter in the ul by using :last-child selector and increase it’s font or to select the second last child i.e. Length label you can use :nth-last-child(2) selector.
Below IS the sample snippet.