πŸŽ‰ New: Top 75 PHP Interview Questions for 2026 β€” Free for all learners
Beginner ⏱ 1 min read πŸ”„ Updated

How to add CSS to homepage only in Shopify?

Advertisement

Regarding your issue, we like to recommend this solution:

Go to Online Store -> Theme -> Edit Code
Go to theme.liquid
Locate and add the following code below:

{% if template.name == “index” %}
{% style %}
.class-name{
background: Blue;
}
{% endstyle %}
{% endif %}

# Summary

Here is what you've learned in this lesson:

    πŸš€
    Next up: Shopify Apply A Code To Only The Home Page only

    Continue to the next lesson and learn more about Shopify Apply A Code To Only The Home Page only.

    Start Next Lesson β†’

    ← Previous Post
    Shopify Apply A Code To Only The Home Page only
    Next Post β†’
    How to make Shopify Custom Font Working? or How To Add A CUSTOM FONT To Your Shopify Site?