A Shopify store owner wants to add a centered, fixed background image that appears only in the main content area, excluding the header and footer.
Initial Problems:
Background image repeats while scrolling instead of staying fixed
Announcement bar at the top became white and nearly invisible
Solution Process:
PageFly support provided CSS code targeting main#MainContent with:
Fixed background attachment
Centered positioning with no-repeat
Background-size: cover
Black background for the announcement bar to restore visibility
Final Issue & Resolution:
The background wasn’t transparent for center content elements. This was resolved by adding CSS to make the .gradient class within main#MainContent have a transparent background using background: transparent !important; in the base.css file.
The solution successfully achieved the desired fixed, centered background image without affecting header/footer areas.
Summarized with AI on November 21.
AI used: claude-sonnet-4-5-20250929.
I want to add a centered background image to my shopify store. This means I don’t want the image to go into the header or footer. This is the coding I added to the bottom of the base.css file:
Do you mean in the regular shopify theme settings or in the theme.liquid? The shopify theme settings don’t allow transparent value and I can’t find anything else. Please help me finish this