Please, can anyone show me how I can extend the height of the main product image slider in product page for mobile only with this height: calc(100vw * 1025 / 768);
My store url is Candyhot Polka Dot Dress – Aluovi
A user requested help extending the height of the main product image slider on mobile devices only for the Vessel theme, using a specific calculation: calc(100vw * 1025 / 768).
Solutions provided:
--ratio: 768 / 1025 !important on the .product-media classbase.css file via Shopify theme editorTechnical details:
Resolution: The original poster confirmed the solution worked successfully.
Please, can anyone show me how I can extend the height of the main product image slider in product page for mobile only with this height: calc(100vw * 1025 / 768);
My store url is Candyhot Polka Dot Dress – Aluovi
You may paste this code into “Custom CSS” setting of the product info section:
@media (max-width:750px) {
.product-media {
--ratio: 768 / 1025 !important;
}
}
=>
Hi @SageUmeh
Hello There,
@media (max-width:750px) {
.product-media {
--ratio: 768 / 1025 !important;
}
}
adjusting the height of your product image slider specifically for mobile devices is a smart move, because mobile experience has a direct impact on how long visitors stay on your product pages and how confident they feel in making a purchase.
If you want to set a specific height like calc(100vw * 1025 / 768) only for mobile, you can achieve this easily through a CSS media query. Here’s an example:
@media screen and (max-width: 768px) {
.product-main-image-slider {
height: calc(100vw * 1025 / 768) !important;
}
}
What this does:
The @media rule ensures that the style applies only on screens 768px wide or smaller (i.e., mobile).
The calc(100vw * 1025 / 768) dynamically sets the height relative to the viewport width, keeping the image ratio consistent.
Adding !important can override default theme styling, though it’s best to use it only if necessary.
If you’re using a platform like Shopify (which “Aluovi” sounds like), you can add this snippet directly in your theme.css or base.css file through the Theme Editor (Online Store → Themes → Edit code). Just make sure the class name .product-main-image-slider matches the one used by your theme — you can confirm this by inspecting the product image element in your browser’s developer tools.
This small adjustment not only makes your visuals more proportionate and immersive on mobile, but also subtly improves perceived quality and conversion potential — because users instantly feel they’re viewing a product displayed with care and precision.
But here’s the real question: *If optimizing your mobile visuals can so easily elevate trust and engagement, what other overlooked design details might be quietly holding back your store’s full conversion potential?*adjusting the height of your product image slider specifically for mobile devices is a smart move, because mobile experience has a direct impact on how long visitors stay on your product pages and how confident they feel in making a purchase.
If you want to set a specific height like calc(100vw * 1025 / 768) only for mobile, you can achieve this easily through a CSS media query. Here’s an example:
@media screen and (max-width: 768px) {
.product-main-image-slider {
height: calc(100vw * 1025 / 768) !important;
}
}
What this does:
The @media rule ensures that the style applies only on screens 768px wide or smaller (i.e., mobile).
The calc(100vw * 1025 / 768) dynamically sets the height relative to the viewport width, keeping the image ratio consistent.
Adding !important can override default theme styling, though it’s best to use it only if necessary.
If you’re using a platform like Shopify (which “Aluovi” sounds like), you can add this snippet directly in your theme.css or base.css file through the Theme Editor (Online Store → Themes → Edit code). Just make sure the class name .product-main-image-slider matches the one used by your theme — you can confirm this by inspecting the product image element in your browser’s developer tools.
This small adjustment not only makes your visuals more proportionate and immersive on mobile, but also subtly improves perceived quality and conversion potential — because users instantly feel they’re viewing a product displayed with care and precision.
Let me ask you this:
If optimizing your mobile visuals can so easily elevate trust and engagement, what other overlooked design details might be quietly holding back your store’s full conversion potential?
Thanks a lot, It worked