Shopify themes, liquid, logos, and UX
I'm trying to apply a background image to a specific multicolumn section on my Shopify site, but the CSS doesn't seem to work as intended. This is the page i'm trying to add it to but will have other sections/pages that I will want to edit soon as well https://q5shfa-15.myshopify.com/pages/room-keys
Here's what I’ve done so far:
I uploaded my image to Shopify and used its URL:
I added the following CSS in my theme editor:
I confirmed that the image URL works (I can view it directly in a browser).
I inspected the multicolumn section in developer tools and identified the class section-template--17947066171589__multicolumn and tried to target it directly, but the style still doesn’t apply.
I also tried adding !important to override any conflicting rules, but it didn’t help.
Shopify shows an error for "Certain at-rules are not supported; try using global CSS", and I’m not sure if my method is valid for targeting only one specific section.
Any insights or suggestions would be greatly appreciated!
Hi @FloorT,
Thank you for reaching out regarding the issue with applying a background image to the multicolumn section on your Shopify site. I’ve reviewed your approach and here’s a detailed response to your questions:
1. Custom CSS for generated multicolumn section: To ensure the background image applies correctly to the multicolumn section, you can use the following CSS code. This should target the generated section correctly.
.multicolumn:has(.section-template--18149098717381__multicolumn_ndbxck-padding) {
background: url(https://cdn.shopify.com/s/files/1/0683/0424/0837/files/IMG_8104.jpg?v=1734480669) no-repeat center center !important;
background-size: cover;
}
This is the expected result:
2. Targeting specific sections: Unfortunately, there is no direct way to apply CSS rules to specific sections of your site without targeting individual-generated classes. Each generated multicolumn section will require a unique CSS rule.
3. CSS Rule application error: Shopify detects errors when CSS rules cannot be applied, and it may trigger a warning. In your case, this is likely because the class .section-multicolumn was used instead of the appropriate .column class. Please make sure you’re targeting the correct class for the section you wish to modify.
I hope my feedback is helpful to you.
Liz
Hello I pasted that code into the CSS for that specific section and it is still not applying. Any other suggestions?
Hi @FloorT , thanks for your feedback. Could you please leave the code in place so I can investigate further and pinpoint the issue?
I appreciate your patience and will get back to you as soon as possible with an update.
Liz
Hi @FloorT,
I’ve reviewed your site, and it seems that the custom CSS we provided hasn’t been added yet. Could you please take a screenshot of where you’ve added the code so we can review it further? This will help us ensure everything is correctly implemented and resolve the issue.
Thanks for your cooperation in this matter.
Liz
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024