Solved

Dawn theme: How to show banner image in mobile without getting chopped

Femmi
Excursionist
30 0 1

Hi all,

I am having trouble with my image banner. It shows well in the desktop version but the mobile version has the left and right side portions cut-off. I am using the 3:2 aspect ration and the image size is 1080x720 pxl size.

 

Here is the link to my website www.femmiflare.com

 

I checked with support and unfortunately support tells me this is how it is for Dawn. I am having a hard time understanding how that could be since its so basic feature. So dissapointing 😞

 

I hope some expert in here has a solution. Thank you so much for taking the time!

 

Accepted Solution (1)
Dan-From-Ryviu
Shopify Partner
7532 1454 1451

This is an accepted solution.

Hi, I fixed it. My mistake when missing i in position code. The code should be like this

@media screen and (max-width: 749px) {
.banner__media { height: auto !important; }
.banner__media img { object-fit: contain !important; position: relative !important; }
}

- Helpful? Like or Accept solution! - Buy me a coffee
- Ryviu - Product Reviews app, collect product reviews, import reviews from AliExpress, Amazon, Etsy, Shopee and Walmart and CSV.
- Lookfy app: Easy and fast to create Photo Gallery, Lookbook, Shop The Look
- Enjoy 1 month of Shopify for $1. Sign up now

View solution in original post

Replies 10 (10)

NomtechSolution
Astronaut
1245 113 148
  1. Adjust the image dimensions: Since the image is cut off on the left and right sides in the mobile version, you can try resizing the image to fit better within the mobile screen. You can experiment with different dimensions, such as reducing the width while maintaining the aspect ratio, to ensure the entire image is visible on mobile devices.

  2. Use media queries: You can use CSS media queries to apply specific styles to the image banner based on the device's screen size. By targeting the mobile viewport, you can adjust the positioning or scaling of the image to make it fully visible. Here's an example of how you can use a media query to adjust the image size for mobile:

 

@media (max-width: 767px) { /* Adjust the max-width value to match your desired mobile breakpoint */
  .image-banner {
    width: 100%; /* Adjust the width as needed */
    height: auto;
    object-fit: contain; /* or object-fit: cover; depending on the desired effect */
  }
}

 

Femmi
Excursionist
30 0 1

Hi, I am not sure which file i need to add this to? I added this code to base.css and made width to 50% and played with different numbers but that has not changed anything and the mobile image is still showing with sides cut-off.

 

Am i doing something wrong or any other solution?

 

Thanks

Rama

Dan-From-Ryviu
Shopify Partner
7532 1454 1451

Please add this CSS at the bottom of your base.css file 

@media screen and (max-width: 749px) {
.banner__media { height: auto !important; }
.banner__media img { object-fit: contain !important; postion: relative !important; }
}

 Screenshot 2023-06-01 at 15.17.07.png

- Helpful? Like or Accept solution! - Buy me a coffee
- Ryviu - Product Reviews app, collect product reviews, import reviews from AliExpress, Amazon, Etsy, Shopee and Walmart and CSV.
- Lookfy app: Easy and fast to create Photo Gallery, Lookbook, Shop The Look
- Enjoy 1 month of Shopify for $1. Sign up now

Femmi
Excursionist
30 0 1

Hi Dan, I tried this solution by adding the script to the bottom of the base.css file.

But now the image banner has completely disappeared from the mobile view. I have attached a picture. 

 

I have to mention i am using the Dawn theme 9.0.0 version. Does the script need to go in someother place?

 

Thank you!

RamaScreenshot (Jun 1, 2023 1_37_15 PM).png

Dan-From-Ryviu
Shopify Partner
7532 1454 1451

Can I request access to your store so I can check and help you? 

- Helpful? Like or Accept solution! - Buy me a coffee
- Ryviu - Product Reviews app, collect product reviews, import reviews from AliExpress, Amazon, Etsy, Shopee and Walmart and CSV.
- Lookfy app: Easy and fast to create Photo Gallery, Lookbook, Shop The Look
- Enjoy 1 month of Shopify for $1. Sign up now

Femmi
Excursionist
30 0 1

Yes, but I am not sure how to give access in a secure way. If you can share your email, i guess i can give you permission?? Sorry never done that before, so you have to help me with that.

 

Dan-From-Ryviu
Shopify Partner
7532 1454 1451

I sent a request to access your store. Please accept it so I can help you

- Helpful? Like or Accept solution! - Buy me a coffee
- Ryviu - Product Reviews app, collect product reviews, import reviews from AliExpress, Amazon, Etsy, Shopee and Walmart and CSV.
- Lookfy app: Easy and fast to create Photo Gallery, Lookbook, Shop The Look
- Enjoy 1 month of Shopify for $1. Sign up now

Femmi
Excursionist
30 0 1

Hi Dan, Happy Friday!

Just did. I would really appreciate to know the changes that you make so i can keep track of my site.

 

Thank you! 

Rama

Dan-From-Ryviu
Shopify Partner
7532 1454 1451

This is an accepted solution.

Hi, I fixed it. My mistake when missing i in position code. The code should be like this

@media screen and (max-width: 749px) {
.banner__media { height: auto !important; }
.banner__media img { object-fit: contain !important; position: relative !important; }
}

- Helpful? Like or Accept solution! - Buy me a coffee
- Ryviu - Product Reviews app, collect product reviews, import reviews from AliExpress, Amazon, Etsy, Shopee and Walmart and CSV.
- Lookfy app: Easy and fast to create Photo Gallery, Lookbook, Shop The Look
- Enjoy 1 month of Shopify for $1. Sign up now

Femmi
Excursionist
30 0 1

Hi Dan, Thank you so so much!! Have a blessed weekend 🙏!!!