Re: Section background image is stretching

Section background image is stretching

solmadestudio
Shopify Partner
16 1 4

store: julisa.com

pword: julialisa21 (the "enter password" link is super small and white in the bottom right corner on desktop. it's hard to see)

 

I have a background image in the newsletter section near the bottom of my homepage. I created the image to fit this section proportionally, but it's scaling up and only showing about half of the image on desktop, and just about 1/5 of the image on mobile.

 

What code can I add to better fit the background image to the size of this section?

Here is the current code I have:

> * {
background: url("https://cdn.shopify.com/s/files/1/0865/3124/4328/files/Julisa_Newsletter_Footer_BG_4.jpg?v=172382669...") !important;
}

 

Julisa Newsletter Footer BG_4.jpgScreenshot 2024-08-21 at 11.54.00 AM.png

Replies 4 (4)

BSSCommerce-HDL
Shopify Partner
2305 848 1065

Hi @solmadestudio

Step 1: Go to Shopify Admin -> Online Store ->Theme -> Edit code

Step 2: Search file theme.liquid

Step 3: Insert this code above </head> tag:

<style>
#shopify-section-template--23181417218344__newsletter_newsletter_xT9C7y > * {
    background-size: cover !important;
}
</style>

Hope this can help you,

If our suggestions are useful, please let us know by giving it a like or marking it as a solution. Thank you 😍

Sale banner, pop ups: Customize your sale banner, pop-ups and create countdown bar to boost conversion rate.
Simicart: Transform your Shopify store into a stunning and fully functional mobile app with just a few simple steps.
Product Labels & Badges:
Get more sales with striking labels, badges, and banners from our 10,000+ available templates.

BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now

solmadestudio
Shopify Partner
16 1 4
Hi, thank you. Unfortunately this didn’t help. Any other ideas?

Made4uo-Ribe
Shopify Partner
8446 2018 2478

Hi @solmadestudio 

Please, replace your code below. 

 

#shopify-section-template--23181417218344__newsletter_newsletter_xT9C7y > * {
    background: url(https://cdn.shopify.com/s/files/1/0865/3124/4328/files/Julisa_Newsletter_Footer_BG_4.jpg?v=1723826694) no-repeat center center !important;
    background-size: cover !important;
}

 

And Save. 

Result:

Made4uoRibe_0-1724277389452.png

 

 

Please don't forget to Like and Mark Solution to the post that helped you. Thanks!

If this fixed your issue Likes and Accept as Solution is highly appreciated. Coffee tips fuels my dedication.
Get EXPERIENCED Shopify developers at affordable rates—visit Made4Uo.com for quick quote!
Do not lost your Shopify store! Get FREE trial with ✔️ Rewind Backup: Automatic, reliable, stress-free.
Need THEME UPDATES but has custom codes? No worries, contact us for affordable price.
solmadestudio
Shopify Partner
16 1 4

Still not working, and this literally placed the code visually on the homepage. Thanks anyway.