New Shopify Certification now available: Liquid Storefronts for Theme Developers

Adapt background image to section

Luca93
Excursionist
13 1 2

Good evening, can anyone tell me how to adapt a background image inserted into a section in the Shopify Dawn theme, in CSS? Because once inserted the image appears "enlarged" while I would like it to adapt to the proportions of the container itself.


I insert this code: > * { background: url("Image URL") !important; }

but then I no longer know how to adapt everything.
Thanks in advance.

Replies 3 (3)
Abdosamer
Shopify Partner
455 73 68

you can add this property to the image :

background-size: cover;
Email : abdelrahamansamer71@gmail.com
Buy me a Coffee
Chat on WhatsApp
Made4uo-Ribe
Shopify Partner
4222 977 1189

Hi @Luca93 

Try to add this one. 

 

background-size: cover; 
 background-repeat: no-repeat;

 

Or 

 

background-size: contain;
  background-repeat: no-repeat;

 

And Save. 

 

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

Please don't forget to 

Like

 and 

Mark Solution 

to the post that helped you. Thanks!
Sip, savor, and support – your

Coffee Tip

 helps us keep coding magic.❤️❤️❤️
Need a knowledgeable developer? Come and visit us at

Made4uo.com


Luca93
Excursionist
13 1 2

I tried, but it doesn't work