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!
Benutzer | RANKING |
---|---|
4 | |
3 | |
2 | |
2 | |
2 |
In diesem Leitartikel werden wir erläutern, warum es wichtig ist, dein Shop als vertrauens...
By Kai Oct 25, 2023Dieser Blog-Beitrag ist eine Zusammenfassung des Webinars Vorbereitung auf BFCM: ein Webi...
By Jacqui Oct 10, 2023Unten sind ein paar wichtige Tipps, die man beachten sollte, wenn man ein neues Thema in d...
By Gabe Oct 6, 2023