I have a page that have responsive video in it, it works great in laptop or any wide screen, but i face a problem of white space above nad below the video in vertical screen like mobiles, i used following ccs code:
.background-video {
position: fixed;
z-index: -10;
top: 0;
right: 50%;
bottom: 0;
min-width: 100%;
min-height: 100%;
-webkit-transform: translate(50%, 0);
-moz-transform: translate(50%, 0);
-ms-transform: translate(50%, 0);
-o-transform: translate(50%, 0);
transform: translate(50%, 0);
background: url(../video/video.jpg) no-repeat;
background-size: cover;
}
.section-video {
position: relative;
background-size: cover;
background-position: 50% 50%;
height: 100vh;
z-index: 0;
}
.section-video .bgvid {
-webkit-transform: translateX(-50%) translateY(-50%);
-moz-transform: translateX(-50%) translateY(-50%);
-ms-transform: translateX(-50%) translateY(-50%);
-o-transform: translateX(-50%) translateY(-50%);
transform: translateX(-50%) translateY(-50%);
position: absolute;
top: 50%;
left: 50%;
min-width: 100%;
min-height: 100%;
width: 100%;
height: 100%;
z-index: -100;
}
here is live preview:
http://shiftmkt.sa/tec/
Try this.
Let me know if you need any changes.
body{
margin: 0;
padding: 0;
}
.section-video .bgvid {
width: 100%;
height: 100%;
}
<div class="section-video">
<video autoplay="" poster="video/video.jpg" class="bgvid" loop="">
<source src="http://shiftmkt.sa/tec/video/video.webm" type="video/webm">
<source src="http://shiftmkt.sa/tec/video/video.mp4" type="video/mp4">
<source src="http://shiftmkt.sa/tec/video/video.ogv" type="video/ogv">
</video>
</div>
Related
I'm doing intro "Merry Christmas" video and I want to use HTML.
https://cleoni.pl/
Chrome - didn't work
Firerfox - it works/didn't work
Opera - it works
Microsoft Edge - it works
#home-bg-video {
position: fixed;
top: 50%;
left: 50%;
-webkit-transform: translateX(-50%) translateY(-50%);
transform: translateX(-50%) translateY(-50%);
min-width: 100%;
min-height: 100%;
width: auto;
height: auto;
z-index: -1;
background: #000000;
background-size: cover;
}
<video id="home-bg-video" poster="../video/CHoinka_AR_001_cam_002.jpg" autoplay>
<source src="../video/2019_choinka_dzwonki_77.mp4" type="video/mp4">
<source src="../video/2019_choinka_dzwonki_77.webm" type="video/webm">
</video>
Is this the effect you are looking for?
#home-bg-video {
position: fixed;
top: 0;
left: 0;
min-width: 100%;
min-height: 100%;
width: auto;
height: auto;
z-index: -1;
background: #000000;
background-size: cover;
animation: mymove 2s;
-webkit-animation: mymove 2s;
}
/* Safari 4.0 - 8.0 */
#-webkit-keyframes mymove {
from {
-webkit-transform: translateX(50%) translateY(50%);
transform: translateX(50%) translateY(50%);
}
to {
-webkit-transform: translateX(0%) translateY(0%);
transform: translateX(0%) translateY(0%);
}
}
/* Standard syntax */
#keyframes mymove {
from {
-webkit-transform: translateX(50%) translateY(50%);
transform: translateX(50%) translateY(50%);
}
to {
-webkit-transform: translateX(0%) translateY(0%);
transform: translateX(0%) translateY(0%);
}
}
<video id="home-bg-video" autoplay>
<source src="https://www.w3schools.com/html/mov_bbb.mp4">
</video>
I want to make a slider, on which there will be a form or any other text.
But when scaling at + 50-75%, as well as with large contents, this content goes beyond.
Image
jsfiddle.net/sL70r2an/
Change position absolute to fixed for .overlay-startpage
.overlay-startpage {
position: fixed;
top: 50%;
left: 50%;
min-width: 100%;
min-height: 100%;
width: auto;
height: auto;
z-index: 0;
-ms-transform: translateX(-50%) translateY(-50%);
-moz-transform: translateX(-50%) translateY(-50%);
-webkit-transform: translateX(-50%) translateY(-50%);
transform: translateX(-50%) translateY(-50%);
}
http://jsfiddle.net/mn4y8exu/
I have tried to put a background video in the first page of the site.
With Safari, IE and Mozilla, the video expands to full screen mode, but not in Chrome. Any advice? Here is the site for reference: http://www.camarche.es
video#bgvid {
position: fixed;
top: 50%;
left: 50%;
min-width: 100%;
min-height: 100%;
width: auto;
height: auto;
z-index: -100;
-ms-transform: translateX(-50%) translateY(-50%);
-moz-transform: translateX(-50%) translateY(-50%);
-webkit-transform: translateX(-50%) translateY(-50%);
transform: translateX(-50%) translateY(-50%);
background: url(polina.jpg) no-repeat;
background-size: cover;
}
I have background <video> on the full page. How can I locate content by center with scrolling over video?
I try to use div with hidden scrollbar, but seem it is not write way.
My HTML code:
<body>
<video autoplay loop poster="polina.jpg" id="bgvid">
<source src="T.webm" type="video/webm">
<source src="T.mp4" type="video/mp4">
</video>
</body>
CSS:
video { display: block; }
video#bgvid {
position: fixed;
top: 50%;
left: 50%;
min-width: 100%;
min-height: 100%;
width: auto;
height: auto;
z-index: -100;
-ms-transform: translateX(-50%) translateY(-50%);
-moz-transform: translateX(-50%) translateY(-50%);
-webkit-transform: translateX(-50%) translateY(-50%);
transform: translateX(-50%) translateY(-50%);
background: url(polina.jpg) no-repeat;
background-size: cover;
}
Ok, before I start, this is what I am trying to achieve using CSS3:
This consists of a responsive diamond shape container (a square, rotated 45 degrees) and four individual diamonds (originally squares but rotated with the parent element, obviously).
Apart from the 1px spacer between diamonds, I've managed to get the shapes to look how I'd like them to look, but I'm finding it very difficult to center align the letters in each diamond, as you can see from my JSFIDDLE DEMO.
HTML
<div id="cover">
<div class="cover-logo-wrapper">
<div id="cover-logo">
<div id="cover-logo-box-1" class="cover-logo-boxes">
<span>T</span>
</div>
<div id="cover-logo-box-2" class="cover-logo-boxes">
<span>D</span>
</div>
<div id="cover-logo-box-3" class="cover-logo-boxes">
<span>O</span>
</div>
<div id="cover-logo-box-4" class="cover-logo-boxes"></div>
</div>
</div>
</div>
CSS
html, body {
position: relative;
width: 100%;
height: 100%;
}
#cover {
position: absolute;
width: 100%;
height: 100%;
left: 0;
right: 0;
top: 0;
bottom: 0;
margin: auto;
}
#cover-logo-wrapper {
position: absolute;
z-index: 5;
left: 0;
right: 0;
top: 0;
bottom: 0;
margin: auto;
width: 10%;
height: 0;
padding: 5% 0;
border: solid 1px rgba(255,255,255,0.2);
}
#cover-logo {
position: absolute;
z-index: 5;
left: 0;
right: 0;
top: 0;
bottom: 0;
margin: auto;
width: 100%;
height: 0;
padding: 50% 0;
background: #FFF;
text-align: center;
-ms-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
}
.cover-logo-boxes {
position: absolute;
width: 50%;
height: 50%;
}
.cover-logo-boxes span {
display: block;
-ms-transform: translateY(-50%) rotate(-45deg);
-moz-transform: translateY(-50%) rotate(-45deg);
-webkit-transform: translateY(-50%) rotate(-45deg);
transform: translateY(-50%) rotate(-45deg);
margin: 0 auto;
text-align: center;
}
#cover-logo-box-1 {
left: 0;
top: 0;
background: red;
}
#cover-logo-box-2 {
right: 0;
top: 0;
background: yellow;
}
#cover-logo-box-3 {
left: 0;
bottom: 0;
background: green;
}
#cover-logo-box-4 {
right: 0;
bottom: 0;
background: blue;
}
Please could somebody point out where I have gone wrong. I assumed using translateY: -50% would have been the winner, but it wasn't.
Try this
.cover-logo-boxes span {
display: block;
transform: translate(-50% -50%);
-webkit-transform: translate(-50%, -50%) rotate(-45deg);
-ms-transform: translate(-50%, -50%) rotate(-45deg);
-moz-transform: translate(-50%, -50%) rotate(-45deg);
top: 50%;
left: 50%;
position: absolute;
}
Demo
Try this
.cover-logo-boxes span {
display: block;
position: absolute; //added this
left: 50%; //added this
top: 50%; //added this
-ms-transform: translateY(-50%) rotate(-45deg);
-moz-transform: translateY(-50%) rotate(-45deg);
-webkit-transform: translateY(-50%) rotate(-45deg);
transform: translateY(-50%) rotate(-45deg);
margin: 0 auto;
text-align: center;
}
Demo Here