Refresh theme, custom CSS changing background

Topic summary

Issue: Custom CSS to set a background image on a specific Shopify section triggers the editor error “Correct the errors to save your custom CSS.” The image is hosted in Shopify Files; URL appears correct.

Key details: The provided CSS is only a declaration block (no selector). One reply suggests removing spaces in the URL/code and sharing a preview link (and password if protected). Another notes a selector (class/id) for the target section is required.

Latest updates: The author tried the corrected code but it still fails, shared a preview link, and reports that a sample/theme image works while their own asset URL does not. They ask for clarification on adding a selector. A follow-up asks which section should receive the styles.

Status: Unresolved/ongoing.

Likely next steps:

  • Identify the exact section and its class/id, then apply CSS with a selector (e.g., .section-class { background: url(“…”) no-repeat center; background-size: cover; }).
  • Ensure the image URL has no spaces/line breaks and is accessible.
  • Share an accessible preview (with password) for debugging.

Note: Code snippets and links are central to this issue.

Summarized with AI on January 10. AI used: gpt-5.

I’m trying to add a background on a selected section with the custom CSS

{
background: url(“https://cdn.shopify.com/s/files/1/0739/4843/0646/files/JPG_YPHomepageWebsiteDesign_Section8-Background_120523_copy.jpg?v=1703142236”)
no-repeat center;
background-size: cover;
}

But it keeps saying " Correct the errors to save your custom CSS"

The image is already in shopify content files, and the URL is correct. I dont know why the error is still there.

Is my syntax incorrect?

Hello @JGTQM2018 ,
Can you share the store URL and the section where the CSS applied?

the theme is not live so I wont be able to share it.

Okay, You can try removing the space from you code:

{
  background: url("https://cdn.shopify.com/s/files/1/0739/4843/0646/files/1766621_YPHomepageWebsiteDesign_EasyHome_1212...") no-repeat center;
  background-size: cover;
}

Also if the theme is not live you can share the preview link for it:

You can right-click on the Edit Code > Copy link address and share it. Also please share the password if the store is password-protected.

You must add class of your section so the code will work.

I’ve tried the code you’ve corrected but it’s still now working :*(

Please see the preview code: https://vumdu2avt4uohph5-73948430646.shopifypreview.com

This code, with their image and its working but I dont understand why my asset isn’t from paste bin . com /Unnr44q5

Hi Dan,

Sorry I dont really follow, would you be able to clarify. I’ve added this code with on the shopify customization on the custom CSS for that section only.

What section do you want to apply the code?