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

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 :disappointed_face:

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

  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 */
  }
}

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; }
}

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

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!

Rama

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

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.

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

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

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; }
}

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