Hide div within last collection item

Hi guys,

I have this collection list inside a dynamic Project page and each list item has a text field inside it with a div next to it, containing a comma. This separates the list of text fields from each other.

I’m looking for a way to hide the div containing that comma ONLY in the last collection item, because obviously that’s where the list ends. How do I achieve this?

Cheers,

Renze


Here is my site Read-Only: LINK
(how to share your site Read-Only link)

Do it with pseudo-classes. Add this custom code in an embed component in the page. Replace .col-item by the class you gave the item, and .divclass by the class of the div you want to hide.

<style>
/* hides element with the .divclass in the last .col-item element of the series */
.col-item:last-child .divclass {display:none}
</style>
3 Likes