I am trying to set a video over another one by using the css property by making the video position relevant to another one.
As you see in the pic I am trying to position the small video in the right corner. However the position of the small screen changes whenever I change the browser screen. For example it changes when I see the website in a bigger screen.
Can you please help me.
<div class="containerdiv">
<video class="own large" id="myvideo" autoplay="true" muted="true"></video>
<video class="own small" autoplay="true" muted="true"></video>
<video class="peer large" autoplay="true"></video>
<video class="peer small" autoplay="true"></video>
</div>
.containerdiv{
position: relative; right: 0; top: 0; left: 0
}
.own.large{
position: relative; top: 0; right: 0%;
width: 40%;
height:50%;
}
.own.small{
position: absolute; top: 80%; right: 50.3%;
width: 15%;
height:20%;
}
.peer.large{
position: relative; top: 0; left: 0% ;
width:40%;
height:50%;
}
.peer.small{
position: absolute; top: 77.5%; right: 16.5%;
width:15%;
height:20%;
}
#camOption{
}
#switchPeerCam{
}
</style>
screen # 2
as you see here the small video is fit within the wanted place.
.own.small{
position: absolute; bottom: 0; right: 0;
width: 15%;
height:20%;
}
.peer.small{
position: absolute; bottom: 0; right: 0;
width:15%;
height:20%;
}
If you give your small window position as percentage, it changes when the screen changed.
Related
.FirstBox {
margin-top: 0;
margin-left: 100px;
margin-bottom: 78px;
height: 60px
}
#BgVideo {
position: absolute;
top: 0;
left: -150px;
top: -650px;
z-index: -100;
}
<div class="FirstBox">
<h1 id="h1">Our secrets</h1>
<div id="BgVideo">
<video playsinline autoplay muted loop width="1640px" height="2060px" src="https://www.w3schools.com/tags/movie.mp4"></video>
</div>
</div>
i tried overflow: hidden; in firstbox class and bgvideo too but didnt work.
i wanna video just be in first box.
video height is 964px.
.FirstBox {
height: 160px;
overflow: hidden;
max-width: 100%;
/* make absolute positioning relative to this div */
position: relative;
}
#BgVideo {
/* calculating height based on the 100% of viewport width and the aspect ratio. */
width: 100vw;
height: calc(9 / 16 * 100vw);
/* center video using absolute positioning */
position: absolute;
top: 0;
left: 0;
/* place the video tag under everything inside .FirstBox div */
z-index: -1;
}
<div class="FirstBox">
<h1>Our secrets</h1>
<video id="BgVideo" autoplay muted> <!-- use the video tag properly with a source tag -->
<source src="https://www.w3schools.com/tags/movie.mp4">
</video>
</div>
I'm trying to make a video background with text over it positioned in a certain way but when I scroll the whole page up the text and video do not scroll/move? What am I doing wrong?
position: fixed;
right: 0;
bottom: 0;
min-width:100%;
min-height:100%;
color: #fff;
z-index:0;
text-shadow: 0 0 5px #000000;
}
.overlayText {
position: fixed;
top: 25%;
left: 25%;
color:#fff;
z-index:1;
}
<div class="bannervideo">
<video autoplay loop muted class="bannervideo" poster="video.jpg">
<source src="/s/Blueheadervideos.mp4" type="video/mp4">
</video>
<center><div class="overlayText">
<p style="font-size:3vw; font-weight: 500;">Headline here</p>
<p style="font-size:1.5vw; font-weight: 500;">tagline</p> </div>
<div class="overlaybottomText">
<p style="font-size:1.5vw;">More words go here </p>
</div> ```
The position: fixed; on both selectors will fix elements relative to the window. Try position: absolute instead for .overlayText
.overlayText {
position: absolute;
top: 25%;
left: 25%;
color:#fff;
z-index:1;
}
and position: absolute or position: relative for the parent element .bannervideo.
I'm creating an earth surrounded by circular graph. The earth is created by using an iframe. I have created a graph and put it inside a dive and managed to overlay the earth on it. It appears fine on desktop but when i open it on phone or tablet, the size of graph behind reduces with screen but the size of earth remains same.
Live URL: https://netzero.co.in/calculator/
I want the earth to adapt screen size i.e make it always look inside the circle graph.
Code:
<style>
.main_content {
width: auto;
height: auto;
position: relative;
}
.earth2{
border-radius:50%;
}
.overlay-effect {
position: absolute;
width: 100%;
height: 100%;
border-radius:50%;
clip-path: circle(160px at center);
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 0;
pointer-events: none;
}
.earth {
width:400px;
height:400px;
border-radius:50%;
left: 50%;
top:50%;
margin-left: -200px;
margin-top: -200px;
padding: 0px;
position: absolute;
clip-path: circle(160px at center);
}
</style>
<div class="main_content">
<div class="graph" id="canvas-holder" style="width:100%">
<canvas id="chart-area" width="500" height="500"></canvas>
</div>
<div class="earth">
<iframe class="earth2" src="https://solarsystem.nasa.gov/gltf_embed/2393" width="400px" height="400px" frameborder="0" >
</iframe>
</div>
<div style="opacity:0%;background-color: rgba(255,0,0,0.5);" class="overlay-effect" id="red-overlay">
hi
</div>
How would I embed a responsive playable youtube video into this tv? (Preferably not on autoplay).
I'm having a hard time with this and was wondering if anyone can help. Thank you.
.tv {
position: absolute;
left: calc(50% - 550px/2);
top: calc(50% - 380px/2);
}
.tv img {
position: absolute;
top: 0;
left: 0;
z-index: 10;
width: 550px;
}
.video {
position: absolute;
top: 25px;
left: 20px;
}
.b {
width: 400px;
height: 300px;
background: black;
}
<div class="tv">
<img src="http://honeypotmarketing.com/wp-content/uploads/OLD-SCHOOL-TV.png" alt="" />
<!-- broken video -->
<div class="video">
<video class="b" src="http://clips.vorwaerts-gmbh.de/VfE_html5.mp4" autoplay></video>
</div>
</div>
For responsiveness you need to add css for div heigh:auto and width in % not pixels, like:
style="max-width:100%;height:auto;"
Hope it works.
Thanks :)
I am trying to make a login form. So far I have managed to hardcode it but once I need to for ex. move one of the wrappers then I got to change every element position in that wrapper. How can I do it so that when moving icon, BG field and text, I only got to change position from one place?
HTML code:
<div id="user-wrapper">
<img id="userfield" src="images/fieldBG.png" alt="Username">
<img id="usericon" src="images/userIcon.png" alt="Username">
<p id="username">
Username
</p>
</div>
<div id="pw-wrapper">
<img id="pwfield" src="images/fieldBG.png" alt="Password">
<img id="pwicon" src="images/pwIcon.png" alt="Password">
<p id="pw">
Password
</p>
</div>
<div id="login-wrapper">
<img id="loginbtn" src="images/loginBtn.png" alt="Login">
<p><a id="login" href="#">
Login
</p>
</div>
CSS code:
#user-wrapper {
position: relative;
top: 100px;
width:1760px;
}
#usericon {
position: absolute;
top: 10px;
left: 740px;
}
#user-wrapper p {
position: absolute;
top: 14px;
left: 840px;
}
#pw-wrapper {
position: relative;
top: 120px;
width:1760px;
}
#pwicon {
position: absolute;
top: 10px;
left: 740px;
}
#pw-wrapper p {
position: absolute;
top: 14px;
left: 840px;
}
#login-wrapper {
position: relative;
top: 140px;
width: 1940px;
}
#login-wrapper p {
position: absolute;
top: 12px;
left: 950px;
}
The whole thing should look like this (but should be editable/positioned with an ease):
Thank You!
Only use
#usericon {
position: absolute;
top: 10px;
float: right;
left: 740px;
}
Okey, I managed to fix it myself.
Instead of width in the wrapper, I had to use left.
For ex.
#user-wrapper {
position:relative;
top:100px;
left:0px;
}
Now I can just only change wrapper parameters top/left and it moves all items inside the wrapper div.