Shopify-Themes, Liquid, Logos und ähnliche Themen
Hello. I want to change the background of a section into an image. Is their a custom css that works for it.
Hey @CedricH
You have reached the German community here but we can chat in English too, that's no problem!
Adding a custom background (BG) to a section depends on a few factors like what theme that is and what section. You will probably need to add it in the code and that can cause some issues if not done correctly such as slow down your page loading speeds and also exclude your theme from the theme updates.
you can use custom CSS to change the background of a section in a Shopify theme to an image. Before getting started, ensure that you have access to your theme's code editor, and also have the image you want to use uploaded to your Shopify files. Here's a general guide on how you might approach this:
Settings
> Files
.class
or ID
that you can use to target the section with CSS.Online Store
> Themes
.Customize
.Theme settings
.Custom CSS
.If you can’t find a place to insert custom CSS directly within the theme settings, you might need to edit your theme’s code:
Themes
in the Online Store
.Edit code
.theme.scss.liquid
file (or similarly named CSS/SCSS file) in the Assets
directory.theme.scss.liquid
file, adjusting the your-section-selector
and image-url
based on your specific details.
your-section-selector {
background-image: url('image-url');
background-size: cover;
background-position: center;
}
Replace your-section-selector
with the class or ID you found when inspecting the element and image-url
with the URL you copied when you uploaded your image.
.section-class {
background-image: url('https://your-shopify-store.com/path-to-your-image.jpg');
background-size: cover;
background-position: center;
}
Save
.If you follow these general steps and adapt them according to your specific theme and section, you should be able to successfully change the background of a Shopify theme section to an image. If you face any issues, consider reaching out to a Shopify expert or a developer for more detailed assistance.
Gabe | Social Care @ Shopify
- War meine Antwort hilfreich? Klicke Like um es mich wissen zu lassen!
- Wurde deine Frage beantwortet? Markiere es als Akzeptierte Lösung
- Um mehr zu erfahren, besuche das Shopify Help Center oder den Shopify Blog
Hello Gabe,
i am currently also trying to have an image as section background.
At first thanks for the step-by-step introduction.
My problem ist that the background-image is not displayed correctly because of the gradient background color of the section color scheme. The section color scheme is always displayed on top. And i cannot remove it or disable it.
In the following screenshot you can see the background-image but also the gradient-color of the scheme. If i disable the gradient color and only use the normal color of the color schema then the background-image is not visible at all.
Customer CSS
Gradient-background color which is displayed on top of the background-image
How can i solve this? I only want the custom CSS to be active. Thanks for the help!
D
Hello
Site link: https://londonfermentary.myshopify.com/
I am using Monaco theme - password is transfer.
I am trying to add a background to the quote section on my homepage and it won't work.
This is the uploaded image URL: https://admin.shopify.com/store/londonfermentary/content/files/38966094266658?selectedView=all
Here is the code I am trying in my base.css file
.shopify-section spaced-section spaced-section--full-width {
background-image: url('https://admin.shopify.com/store/londonfermentary/content/files/38966094266658?selectedView=all'); /* Replace with your actual image URL */
background-size: cover; /* Ensures the image covers the entire section */
background-position: center; /* Centers the image within the section */
}
Below is the section I want to add the illustrations and below that is the illustration artwork.
Teil 2 - Wie die Prinzipien des UX-Designs dir dabei helfen können einen großartigen Shop ...
By Kai Sep 16, 2024Teil 1 - Wie die Prinzipien des UX-Designs dir dabei helfen können einen großartigen Shop ...
By Kai Sep 9, 2024Anpassungen des benutzerdefinierten Codes an Shopify-Themes (CSS) leicht gemachtIn diesem...
By Gabe Aug 28, 2024