0

I'm creating a Shopify website and I want to show a hero video on the top. But the video is somehow leaning to the right, leaving a blank on the left. Anyone knows how I can make it 100% responsive? I don't know much about coding and I did everything I could... any help is appreciated.

Spent three days searching but in vain...

My website is here: https://v3xt5u4y7es2qbjl-22601531467.shopifypreview.com

The video on the top currently is not exactly what I want. I actually just want to keep the second video.

HTML

<div id="hero_video">
<video autoplay="" playsinline="" muted="" loop="" id="Hero_Video">
  <source src="https://cdn.shopify.com/s/files/1/0226/0153/1467/files/background_video_1.mp4?1009" type="video/mp4">
</video>
</div>

CSS

#Hero_Video {
  position: relative;
  width: 100vw;
  max-height: 100%;
}

/* Hero Video Style*/
.hero_video{
    left: 50%;
    margin-left: -200vw;
    margin-right: -50vw;
    max-width: 100vw;
    position: relative;
    right: 50%;
    width: 100vw;
}
4

2 回答 2

1

将宽度 100% 添加到您的视频中,它应该可以工作

#Hero_Video {
    width: 100%;
}
于 2019-05-16T06:29:45.327 回答
0
    #Hero_Video {
      position: relative;
      ....
    }

    /* Hero Video Style*/
    .hero_video{
        left: 50%;
        ...
        width: 100vw;
    }
> <div id="hero_video"> <video autoplay="" playsinline="" muted=""
> loop="" id="Hero_Video">

“。” 用于类,“#”用于 id。首先,我认为你的css在这里有问题

于 2019-05-16T07:20:48.677 回答