视频的中心对齐ofwordpress .css遇到麻烦
由于某种原因,我无法在最大程度地限制宽屏显示器时,在横幅上使用的视频在屏幕中心停留在我的公司oneoptics.io上的登陆页面上。所有其他元素似乎都保持中心,但视频拥抱了屏幕的左侧。任何帮助将不胜感激。这是当前正在使用的CSS。
body{
font-family: 'Poppins', sans-serif!important;
}
.main_logo img{
width: 100%;
}
#header{
padding: 25px 0;
}
.main_menu{
text-align: right;
margin-top: 15px;
}
.menu_ul{
padding: 0;
margin: 0;
}
.menu_ul li{
display: inline;
padding: 0 0 0 90px;
}
.menu_ul li a{
font-size: 20px;
color: #000000;
font-weight: 500;
}
.banner_sec{
<!-- background-image: url('http://www.oneoptics.io/wp-content/uploads/2022/06/100240044-aerial-drone-san-francisco-cit_H264HD1080.mp4'); -->
background-size: cover;
background-position: center;
background-repeat: no-repeat;
height: 700px;
width: 100%;
position: relative;
}
.banner_overlay{
background-color: #00000000;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.background-video {
object-fit: cover;
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
z-index: -1;
overflow: hidden;
}
@media (max-width: 5000px) {
.banner_sec{
background-image: url('http://www.oneoptics.io/wp-content/uploads/2022/06/100240044-aerial-drone-san-francisco-cit_H264HD1080.mp4');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
height: 700px;
width: 100%;
position: center;
}
}
.banner_txt{
position: relative;
z-index: 999;
margin-top: 215px;
text-align: center;
}
.banner_txt strong{
font-size: 35px;
color: #ffffff;
font-weight: 500;
display: block;
}
.banner_txt strong span{
display: block;
margin-top: 50px;
}
.banner_txt a{
font-size: 22px;
letter-spacing: 3px;
color: #000000;
font-weight: 400;
background: #fff;
transition-duration: 0.4s;
margin-top: 180px;
padding: 20px 75px;
display: inline-block;
border-radius: 50px;
text-decoration: none;
text-transform: uppercase;
}
.banner_txt a:hover{
background: #000;
color: #fff;
}
I am working on a landing page for my company oneoptics.io for some reason I cannot get the video that is being used in my banner to stay in the center of the screen when maximizing on a widescreen monitor. All of the other elements seem to stay centered but the video hugs the left side of the screen. Any help would be appreciated. Here is the CSS that is currently in use.
body{
font-family: 'Poppins', sans-serif!important;
}
.main_logo img{
width: 100%;
}
#header{
padding: 25px 0;
}
.main_menu{
text-align: right;
margin-top: 15px;
}
.menu_ul{
padding: 0;
margin: 0;
}
.menu_ul li{
display: inline;
padding: 0 0 0 90px;
}
.menu_ul li a{
font-size: 20px;
color: #000000;
font-weight: 500;
}
.banner_sec{
<!-- background-image: url('http://www.oneoptics.io/wp-content/uploads/2022/06/100240044-aerial-drone-san-francisco-cit_H264HD1080.mp4'); -->
background-size: cover;
background-position: center;
background-repeat: no-repeat;
height: 700px;
width: 100%;
position: relative;
}
.banner_overlay{
background-color: #00000000;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.background-video {
object-fit: cover;
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
z-index: -1;
overflow: hidden;
}
@media (max-width: 5000px) {
.banner_sec{
background-image: url('http://www.oneoptics.io/wp-content/uploads/2022/06/100240044-aerial-drone-san-francisco-cit_H264HD1080.mp4');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
height: 700px;
width: 100%;
position: center;
}
}
.banner_txt{
position: relative;
z-index: 999;
margin-top: 215px;
text-align: center;
}
.banner_txt strong{
font-size: 35px;
color: #ffffff;
font-weight: 500;
display: block;
}
.banner_txt strong span{
display: block;
margin-top: 50px;
}
.banner_txt a{
font-size: 22px;
letter-spacing: 3px;
color: #000000;
font-weight: 400;
background: #fff;
transition-duration: 0.4s;
margin-top: 180px;
padding: 20px 75px;
display: inline-block;
border-radius: 50px;
text-decoration: none;
text-transform: uppercase;
}
.banner_txt a:hover{
background: #000;
color: #fff;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将背景视频和浮动文本的部分分开 -
然后更改两个部分的CSS。
You can separate the section of background video and floating text like this -
Then change the css of both section.