Shopify themes, liquid, logos, and UX
Hi,
Can someone help me hide a video on desktop but keep on mobile view. The video is just too big on desktop but look perfect on mobile.
I'm using a custom liquid with this code
<style>
video {
width: 100%;
height: auto;
display: block;
margin: 0 auto;
}
</style>
<video muted autoplay playsinline loop>
<source src=" "
type="video/mp4">
<source src=" "
type="video/mp4">
</video>
and the theme is Studio.
Please give me step by step instructions. I'm still pretty new and sometimes don't understand 🙂
Thank you.
Solved! Go to the solution
This is an accepted solution.
Hi @valerie92
In this case you can add a class for video like this
<video class="hidden-desktop" muted autoplay playsinline loop>
<source src=" "
type="video/mp4">
<source src=" "
type="video/mp4">
</video>
Then add this css into CSS file
@media(min-width: 767px){
.hidden-desktop{
display: none;
}
}
This is an accepted solution.
Hi @valerie92
In this case you can add a class for video like this
<video class="hidden-desktop" muted autoplay playsinline loop>
<source src=" "
type="video/mp4">
<source src=" "
type="video/mp4">
</video>
Then add this css into CSS file
@media(min-width: 767px){
.hidden-desktop{
display: none;
}
}
It worked! Thank you so much 🙂
Hi Michael,
I am still having issues with this code, are you able to assist? Thank you!
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025