Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
I'm using Views to create a list of articles. I want to style the first and the last article in the list differently. How can I add a css class to them so that I may access them?
I looked everywhere for an answer and would really appreciate if anyone could help me out.
Comments
You can theme views
You can theme views individually.
The theme function loops through all items so can add css classes to the first and last items here.