Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hello,
Im having an issue coding a video into my shopify store, it works on desktop but on Mobile the video will pop up full screen taking over the whole screen on the phone. I just want want it to play in the background not taking over the entire screen. Please if you guys find any errors in my code and why its happening only on mobile please let me know.
https://www.chaseabagmerch.com/
Here is the custom liquid:
<div class="video-container">
<div class="video_text">
<p class = "top">
WELCOME TO
</p>
<h1 style = "opacity:0.9; font-family:Lucinda, cursive;"> Chase A Bag Clothing
</h1>
<p>
</p>
<a href="https://www.chaseabagmerch.com/collections/all" class="button" style = "opacity:.85;">SHOP NOW</a>
<br>
</div>
<video loop="loop" muted="" autoplay="autoplay" style="max-width: 100%; height: ; opacity:0.45;">
<source src="https://cdn.shopify.com/videos/c/o/v/7296c45691c84f6997e1021133e1e17f.mov" type="video/mp4" />
Your browser does not support our video.
</video>
</div>
<p style="text-align:center";></p>
</div>
</div>
<style>
.video-container {
position: relative;
}
.video_text {
position: absolute;
z-index: 9999;
bottom:15%;
top:20%;
left: 15%;
right:15%;
padding: 10px;
text-align:center;
}
.video_text h1{
font-size:100px;
}
.video_text p{
font-size:25px;
margin:3% 10%;
}
@media (min-width: 1201px) {
.video_text {
position: absolute;
z-index: 9999;
top:7;
text-align:center;
}
.video_text h1{
font-size:90px;
margin:2% 8%;
color:white;
}
.video_text p{
font-size:20px;
color:white;
margin:8px;
padding:5px;
}
}
@media (max-width: 1201px) {
.video_text {
position: absolute;
z-index: 9999;
top:1;
text-align:center;
}
.video_text h1{
font-size:80px;
margin:1% 10%;
color:white;
}
.video_text p{
font-size:18px;
color:white;
margin:5px;
padding:1px;
}
}
@media (max-width: 1024px) {
.video_text {
position: absolute;
z-index: 9999;
top:10;
font-size: 20px;
text-align:center;
}
.video_text h1{
font-size:65px;
margin-top:1px;
}
.video_text p{
font-size:13px;
color:white;
margin:1px;
padding:10px;
}
.button{
margin:
}
}
@media (max-width: 767px) {
.video_text {
position: absolute;
z-index: 9999;
top:3%;
font-size: 20px;
text-align:center;
}
.video_text h1{
font-size:42px;
}
.video_text p{
font-size:12px;
color:white;
margin:1px;
}
.button{
color:white;
font-size:13px;
padding:px;
margin:1px;
}
.video_text .top {
font-size:12px;
}
}
@media (max-width: 401px) {
.video_text {
position: absolute;
z-index: 9999;
top:1%;
font-size: 20px;
text-align:center;
}
.video_text h1{
font-size:27px;
}
.video_text p{
font-size:0px;
color:white;
}
.button{
color:white;
font-size:13px;
margin-bottom: 10px;
}
.video_text .top {
font-size:8px;
}
}
</style>
Hello Naeem,
Thank you for the response, however im still facing issues implementing the code you have mentioned for the video element.
This is the code I replaced for the video and now the video does not play at all and is in a different format than the rest of the website. Could you take over and implement these changes for me? If so I would like your email so I can add you as an admin. Thank you.
<video class ="background-video " loop muted autoplay playinline style ="max-width:100% opacity:0.45;">
<source src="https://cdn.shopify.com/videos/c/o/v/7296c45691c84f6997e1021133e1e17f.mov" type="video/mp4" />
Your browser doesn't support our video.
</video>
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024