Keep original image ratio in Dawn theme / Image & Text

Keep original image ratio in Dawn theme / Image & Text

INFRA
Shopify Partner
234 2 83

Hi there,

 

I have the image &text section showing up like below, but I want the section to be the height of the image (2nd example).  What code could I use for this?

 

Current:

 

Screenshot 2024-10-10 at 12.10.30.png

 

 

I would like it to show like below instead:

 

Screenshot 2024-10-10 at 12.13.22.png

 Thanks!

 

Website

password: fbc

Replies 7 (7)

TikitaTech
Shopify Partner
71 18 18

Hey @INFRA

What page is this image on?

Daeda Wishlist - a simple wishlist
Co-founder @ Daeda Technologies to make tech simple
INFRA
Shopify Partner
234 2 83

ah sorry, it's here!

TikitaTech
Shopify Partner
71 18 18

Hi @INFRA!

In Admin, go to Main Content, with the section 'Daytrips Galore'.

 

Add Custom CSS:

 

 

@media screen and (min-width: 750px) {
  .page-width {
    padding: 0;
  }
}

.page-width {
  max-width: 100%;
  margin: 0;
}

 

This will achieve this:

2024-10-10T12_25_49,761412912+07_00.png

 

 Let me know if you need any more details. Hope this helps!

Daeda Wishlist - a simple wishlist
Co-founder @ Daeda Technologies to make tech simple
INFRA
Shopify Partner
234 2 83

hi, I'm getting below error. Anything else I can try? Or is it interfering with the code I've added above it ? Thanks so much for your help!

 

Screenshot 2024-10-10 at 19.53.13.png

TikitaTech
Shopify Partner
71 18 18

Ah, it might be that the overlap in screen sizes is causing the errors, try this and let me know if your Custom CSS still has errors.

@media (max-width: 767px) {
    .image-with-text__grid {
        flex-wrap: wrap-reverse;
    }
}

@media (min-width: 768px) {
    .page-width {
        padding: 0;
        margin: 0;
        max-width: 100%;
    }
}

 

Daeda Wishlist - a simple wishlist
Co-founder @ Daeda Technologies to make tech simple
INFRA
Shopify Partner
234 2 83

thanks again!

 

I think .page-width might be the issue here?

 

Screenshot 2024-10-11 at 16.08.16.png

TikitaTech
Shopify Partner
71 18 18

I believe the issue is that Custom CSS is not allowing media queries in this specific section.

To apply this media query, you’ll need to add the styles to the global CSS file.

 

Go to Admin > Online Store > Themes, click on the three dots next to the theme, and select Edit Code.2024-10-11T12_27_03,350798122+07_00.png

 

In the sidebar, go to assets. You’ll see a list of .css and .js files. Look for a file that matches the section’s name, possibly something like section-template.css or main-content.css.

2024-10-11T12_35_52,637029000+07_00.png

 

Open that file and press Ctrl+F (or Cmd+F on a Mac) to bring up the search bar.

Type in 'page-width'. Once you find it you can add or adjust the CSS as in the above message.

 

Let me know if you find the right section. I hope this helps!

Daeda Wishlist - a simple wishlist
Co-founder @ Daeda Technologies to make tech simple