A user working with Shopify’s Colorblock theme needed help adding a homepage background image and centering their navigation menu.
Background Image Solution:
Initial attempts failed when code was placed at the bottom of base.css
Success achieved by placing CSS code at the TOP of the base.css file:
body {
background: url("image_url_path") no-repeat important!;
background-size: cover important!;
}
Menu Centering:
Added to bottom of base.css:
.header__inline-menu {
justify-self: center important!;
}
Full-Page Image Display:
To show the entire background image without adding sections, this code was added to the TOP of base.css:
#MainContent {
min-height: 100vh;
}
All solutions were successfully implemented. The key issue was CSS placement—background styling needed to be at the file’s top, while menu styling went at the bottom.
Summarized with AI on November 22.
AI used: claude-sonnet-4-5-20250929.
I’m using the colorblock theme and trying to add a background image only on the homepage. I’ve read through previous questions and followed the codes shown, but nothing seems to be working. Any suggestions?
Also, I’ve been trying to get my menu on the same line as my logo and have slightly succeeded (by following codes suggested to others) but now my menu text seems to be anchored to my logo now and overlays it. I’m not sure how to center the menu and have the logo on the left side. I have no coding knowledge so this is all pretty new to me.
This is Richard from PageFly - Landing page builder, I’d like to suggest this idea:
Step 1: Go to Online Store->Theme->Edit code
Step 2: Asset->/base.css->paste below code at the bottom of the file:
body {
background: url("url_image_path") no-repeat !important;
background-size: cover !important;
}
Unfortunately that didn’t work. I also tried it on the Dawn theme just to see if it was specifically Colorblock that was giving me trouble, but it didn’t work for Dawn either.
Perfect! Thank you so much for clarifying. One last question if you don’t mind, I’d like the homepage to basically be just the full image with the logo on top as is and a transparent footer on the bottom. Is there any way to show the entire image without having to add various sections? I’d like to be able to scroll the page.
Sure, I’m happy to help you. Let’s try this solution:
Step 1: Go to Online Store->Theme->Edit code
Step 2: Asset->/base.css->paste below code at the TOP of the file: