Shopify themes, liquid, logos, and UX
Hi i want the video to not show on mobile but don't understand what's wrong with this code
<style>
@media screen and (min-width: 768px)
{
video {
display: block;
margin: 0 auto;
width: 100%;
height: 100%;
}
}
@media screen and (max-width: 768px)
{
video {
display: none;
}
}
</style>
<video autoplay loop playsinline muted>
<source src="https://cdn.shopify.com/videos/c/o/v/35fa068e97f84cfdb642d30b40cf7ce6.mp4"
</video>
Solved! Go to the solution
This is an accepted solution.
Hello @Zetterman 👋
You should use this code instead
<style>
video {
margin: 0 auto;
width: 100%;
height: 100%;
}
@media screen and (max-width: 768px){
video {
display: none;
}
}
</style>
<video autoplay loop playsinline muted>
<source src="https://cdn.shopify.com/videos/c/o/v/35fa068e97f84cfdb642d30b40cf7ce6.mp4">
</video>
Hope that helps!
Hi there,
Try to use !important and the end of the CSS style, as below:
video {
display: none !important;
}
Cheers!
GO Immobilier, spécialiste en Digital Marketing Suisse.
Hi @Zetterman
Try the video tutorial below to only show certain section on specific device.
This is an accepted solution.
Hello @Zetterman 👋
You should use this code instead
<style>
video {
margin: 0 auto;
width: 100%;
height: 100%;
}
@media screen and (max-width: 768px){
video {
display: none;
}
}
</style>
<video autoplay loop playsinline muted>
<source src="https://cdn.shopify.com/videos/c/o/v/35fa068e97f84cfdb642d30b40cf7ce6.mp4">
</video>
Hope that helps!
Thank you so much!
You are welcome 🙂
How about the opposite? Displaying it on mobile but not desktop? Whats the code for that?
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