I’d like to make the product image full width and with 0 padding to the top. I think I have figured out the padding to the top, however, the image is in the whole div of the full page, so I am not sure how to make it 100% width with 0 padding left and right.
I would prefer not to share the URL of the page because of privacy reasons, however, it’s a simple default dawn theme without anything custom except for this:
In the main-product.liquid section I added the padding, margin and overflow.
.section-{{ section.id }}-padding {
padding-top: 0px;
margin-top: -10px;
overflow: hidden;
padding-bottom: {{ section.settings.padding_bottom | times: 0.75 | round: 0 }}px;
}
Hello There
To make a mobile product image full width on the Shopify Dawn theme, you can follow these steps:
- Go to your Shopify store’s admin panel and click on “Online Store” in the left-hand menu.
- Click on “Themes” and then click on the “Actions” button for the Dawn theme.
- In the “Actions” dropdown, select “Edit code.”
- In the “Layout” folder, click on “theme.scss.liquid” to open it in the editor.
- Scroll down to the bottom of the file and add the following code:
@media screen and (max-width: 749px) {
.product-single__photo {
width: 100%;
}
}
- Save your changes by clicking the “Save” button at the top of the page.
This code will apply to all product pages on your store, and will make the product image full width on mobile devices with screen widths up to 749 pixels. If you want to adjust the screen width at which this change is applied, you can adjust the value in the max-width media query.
hope this helps!