Shopify themes, liquid, logos, and UX
Hello everyone,
For my website i want to use a different picture on desktop than mobile. I saw some other discussions here with the code but after i applied the code i saw one brick with the picture for desktop and the second brick (where the picture for mobile was) stayed blank. Can anyone help me with this, i use the theme origin.
Kind regards
Hi,
Identify the CSS class or ID of the element where you want to change the background image.
After that need to Add Custom CSS at theme.scss.liquid or styles.scss.liquid file
/* Desktop */
@media only screen and (min-width: 769px) {
.custom-section {
background-image: url('URL_TO_YOUR_DESKTOP_IMAGE');
}
}
/* Mobile */
@media only screen and (max-width: 768px) {
.custom-section {
background-image: url('URL_TO_YOUR_MOBILE_IMAGE');
}
}
Is there also a possibility where i don't need to use a URL for the banner?
For this you have to edit your current banner code which will let you upload the mobile version of banner.
Let me know if interested.
User | RANK |
---|---|
229 | |
165 | |
66 | |
55 | |
49 |
On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023The year-end shopping season is just around the corner. Is a flash sale on your radar? Are...
By Jasonh Nov 6, 2023