How to display a different style for products from specific a category?

Topic summary

A user wants to apply custom CSS styling (specifically a red stroke) to product images from a specific collection (\

Summarized with AI on November 25. AI used: claude-sonnet-4-5-20250929.

I was wondering how to display a different style for products from specific a category?

Let’s say I’m on the website’s main page and I have some products (in a “sale” collection) showing if in the mix. I would like to have their pictures with a red stoke. I know how do do the CSS, but I can’t find a way to code the LIQUID query on it.

I tried lots of code and the last one is:

{%- if product.collections contains ‘sale’ -%}
My extra styles here
{% endif %}

Here’s the result I’m hoping:

Thanks in advance for you help

Hi Caron231,

What’s the name of the Shopify theme you’re using?

At the moment I’m using the basic Dawn theme