Delay display of an object is moving items on different z-indexes - html

I have a container div. Inside that I have 6 things. A banner div, an upperstrip div, a video div, a counter div and a bottom div. Inside the bottom div is a lowerstrip div.
When the delayed item displays it bumps the lowerstip div down the page by the amount the the counter is located. All of these divs except for the container have z-indexes called out in my CSS.
<div id="container" style="text-align: center;">
<div id="banner">
<img src="banner.png" alt="banner" />
</div>
<div id="upperstrip">
<p><h2 style="color:white; background-color: #0f2781;">
Puzzle Registration </h2></p>
</div>
<div id="video">
<video controls autoplay>
<source src="prsm_animation.mp4" type="video/mp4">
Your browser does not support HTML5 video.
</video>
<div id="counter" data-delay="9" style="display:none; width: 100%">
</br>
<a href="http://www.xxxx.com">
<img src="bluebar.jpg" alt="bluebar" /></a>
</div>
</div>
<div id="bottom">
<div id="lowerstrip">
<p><h4 style=" color: white; vertical-align:bottom;
background-color: #0f2781; text-transform: uppercase;">
Enter your puzzle number in the blue bar above to
register for these
great prizes! </h4></p>
</div>
</div>
</div>
My CSS looks like this:
#video {
position: absolute;
z-index: -10;
}
#counter {
position: absolute;
top: 0px;
width: 803px;
margin: auto;
text-align: center;
z-index: 10;
}
#upperstrip {
position: static;
width: 850px;
text-transform: uppercase;
z-index: 40;
}
#lowerstrip {
position: static;
width: 850px;
top: 400px;
height: 19px;
z-index: 60;
}
#bottom {
position: absolute;
width:850px: height: 1300px;
z-index: 80;
background-color: #ff0000;
}

Related

HTML/CSS Floating a <div> to the right but it leaves a space between

I am trying to move a div to the right of the page to make something more complex, i.e. to have an image inside of it.
I want to make this image touch the right of the page but it always leaves a space. When I try to use position, it creates a side bar on the side and continues to have the space.
Here is an image of the space
Here is my code:
body {
background-image: url('wallpp.png');
background-repeat: no-repeat;
background-attachment: fixed;
background-size: 100% 100%;
z-index: 0;
font-family: 'Comfortaa';
}
#logo1-div {
position: relative;
text-align: center;
}
.saudacoes {
position: relative;
color: white;
width: 700px;
left: -30px;
}
.saudacoes-text {
position: absolute;
top: 10px;
left: 112px;
text-align: center;
font-size: 18px;
}
#index {
text-align: left;
position: relative;
left: -60px;
}
.nossahistoria {
margin-top: 50px;
float: right;
}
.nossahistoria-text {}
<div id="logo1-div">
<img src="logo1.png" width="250">
</div>
<div class="saudacoes">
<img src="retangulo2.png" width="700">
<div class="saudacoes-text">
<h3>Olá bem vindo ao site oficial do Paula Cakes.</h3>
<a>Aqui você poderá encontrar:<br></a>
<div id="index">
•Nossa História.<br>
•Nossos produtos.<br>
•Redes sociais.<br>
•Onde pode nos encontrar.<br>
•Informações sobre a criação deste site.
</div>
</div>
</div>
<div id="nossahistoria-index" class="nossahistoria">
<img src="retangulo2.png" width="600" height="1000">
<div class="nossahistoria-text">
<h2>Nossa História</h2>
</div>
</div>
<div id="nossosprodutos-index">
</div>
<div id="redessociais-index">
</div>
<div id="ondepodenosencontrar-index">
</div>
<div id="infosdosite-index">
</div>
Maybe you have to add margin: 0 and padding: 0 attribute to body selector.
body {
margin: 0;
padding: 0;
...
}

Centered Horizontally 2 Divs | One Under Other

I'm trying to make 2 divs centered horizontally and one under the other. Actually i did it with some trial and error but i couldn't make it resolution independent. It's looking weird with other resolutions except 1920*1080. I tried percantage but i couldn't make it. My div jumped to the left top corner. Here how my divs look like in 1920*1080 :
I know i shouldn't use this position,width and height pixels but i couldn't get this view without them. So i made it for clarity for my problem.
Here my html codes :
<body>
<div name="video-div" id="videodiv" style="position:absolute; left:320px; top:10px;">
<video id="videoPlayer" controls>
<source src="" type="video/mp4">
</video>
</div>
<div id="info-div" style="position:absolute; left:320px; top:740px;">
</div>
<div name="test2" id="div2">
<ul id="ultimes">
<li>test</li>
</ul>
</div>
<div name='test' id="div1">
<input id="datepicker" type="text" placeholder="Tarihi Seç">
<form id="form">
<button type="submit" id="listele">Listele</button>
</form>
<ul id="list1">
<li>test</li>
</ul>
<ul id="ullogs">
<li>test</li>
</ul>
</div>
</body>
Here my css codes :
#info-div{
background-color:white;
border:1px solid black;
height:200px;
width:1280px;
}
#videodiv{
width: 1280px;
height: 720px;
background-color: red;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
/*margin: auto;*/
}
#videoPlayer {
object-fit: fill; /* it's not filling the div */
}
#div1 {
padding-top: 50px;
padding-left: 20px;
padding-right: 20px;
width: 25vh;
height: 100vh;
background-color: #d5f4e6;
}
#div2 {
float: right;
padding-top: 50px;
padding-left: 20px;
padding-right: 20px;
width: 25vh;
height: 100vh;
background-color: #d5f4e6;
}
body{
margin:0px;
padding:0px;
background-color: #80ced6 !important;
overflow: hidden;
}
#form {
margin-bottom: 40px;
}
If I get this correct. All you want to do is center two divs horizontally one under another (the video and the info div) with the video-div filling 100% width.
Have you tried wrapping them in another div and centering that horizontally? Doing this and giving the wrapper-div a width should work.
.wrapper-div {
position: absolute;
left: 50%;
transform: translateX(-50%);
width: 1280px
}
.video-div {
width: 100%;
}
<div class="wrapper-div">
<div name="video-div" id="videodiv">
<video id="videoPlayer" controls>
<source src="" type="video/mp4">
</video>
</div>
<div id="info-div">
</div>
</div>

Horizontally center video in Bootstrap

Researched elsewhere, can't find a solution to horizontally center a video in a Bootstrap div / header section while keeping the video vertically aligned with the top. Div / header section is 100% width with two fixed heights at certain viewport breakpoints.
I've tried removing/renaming the <header> tag in case Bootstrap's styles interfere. Tried <center> tags, specifying the video tag as display:inline and many many other attempts.
The video in this example centers at certain breakpoints but otherwise is left-aligned. I'd like it to be centered throughout all viewport widths, and top aligned as well.
Thanks very much!
HTML:
<header>
<video loop muted autoplay poster="images/3671960.jpg" class="fullscreen-video">
<source src="video/3671960.mp4" type="video/mp4">
</video>
<div class="header-content">
<div class="header-content-inner">
<h1>A bunch of header text.</h1>
</div>
</div>
<div class="launcher">
<div class="launcher-inner">
Button text
</div>
</div>
CSS :
header {
position: relative;
text-align: center;
top: 0;
left: 0;
width:100%;
height: 475px;
color: #fff;
overflow: hidden;
margin: 0 auto;
}
header .fullscreen-video {
position: absolute;
top: 0;
left: 0;
min-width:100%;
min-height:100%;
z-index: -100;
}
#media (min-width: 768px) {
header {
height: 665px;
}
}
HTML
<header>
<video loop muted autoplay poster="images/3671960.jpg" class="fullscreen-video">
<source src="video/3671960.mp4" type="video/mp4">
</video>
<div class="header-content">
<div class="header-content-inner">
<h1>A bunch of header text.</h1>
</div>
</div>
<div class="launcher">
<div class="launcher-inner">
Button text
</div>
</div>
</header>
CSS
header {
position: relative;
text-align: center;
top: 0;
left: 0;
width:100%;
height: 475px;
color: #fff;
overflow: hidden;
margin: 0 auto;
}
header .fullscreen-video {
position: absolute;
left: 50%;
top: 0;
-ms-transform: translateX(-50%);
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
min-width:100%;
min-height:100%;
z-index: -100;
}
#media (min-width: 768px) {
header {
height: 665px;
}
}
Demo Link : https://jsfiddle.net/hellosrini/vwc5hek0/

How to add objects in a DIV and appear above the DIV

I am trying to add an image and a textbox inside a DIV that has a opacity of 60%. For some reason the two objects also inherits the opacity as well. How do I prevent it?
HTML:
<body>
<div id="sliderdiv">
<div id="slider">
<img src="i2.jpg" alt="" />
<img src="i3.jpg" alt="Pure Javascript. No jQuery. No flash." />
<img src="i4.jpg" alt="#htmlcaption" />
<img src="i5.jpg" />
</div>
<div id="htmlcaption" style="display: none;">
<em>HTML</em> caption. Link to Google.
</div>
</div>
<div id="bg">
<img src="wmlogo.jpg" width="140" height="30" alt="Westmed Medical Group" title="Westmed Medical Group Homepage" id="logoimg" />
<input type=text size=25 id=insidebgtext />
</div>
</body>
CSS:
* {
background-color: #CC0000;
padding: 0px;
margin: 0px;
}
#bg {
position: absolute;
background-color: #000000;
height: 50px;
width: 100%;
opacity:0.6;
filter:alpha(opacity=60); /* For IE8 and earlier */
z-index: 1;
}
#insidebgtext {
position: absolute;
top: 25%;
right: 20%;
background-color: #FFFFFF;
z-index: 25;
}
#sliderdiv
{
position:absolute;
left:0px;
top:0px;
width: 100%;
height: 306px;
z-index:-1;
background-color: #FCFCFC;
}
#logoimg {
position: absolute;
top: 15%;
left: 25%;
z-index: 25;
}
How it appears:
The inheritance of the properties of parents in the child in very obvious. For your purpose you can use a proxy way of using a transparent png image for the background and avoid the use of opacity all together.

Overlaying a DIV On Top Of HTML 5 Video

I need to overlay a div ON TOP of a div containing an HTML 5 video. In the example below the overlaying div's id is "video_overlays". See example below:
<div id="video_box">
<div id="video_overlays"></div>
<div>
<video id="player" src="http://video.webmfiles.org/big-buck-bunny_trailer.webm" type="video/webm" onclick="this.play();">Your browser does not support this streaming content.</video>
</div>
</div>
Here is a stripped down example, using as little HTML markup as possible.
The Basics
The overlay is provided by the :before pseudo element on the .content container.
No z-index is required, :before is naturally layered over the video element.
The .content container is position: relative so that the position: absolute overlay is positioned in relation to it.
The overlay is stretched to cover the entire .content div width with left / right / bottom and left set to 0.
The width of the video is controlled by the width of its container with width: 100%
The Demo
.content {
position: relative;
width: 500px;
margin: 0 auto;
padding: 20px;
}
.content video {
width: 100%;
display: block;
}
.content:before {
content: '';
position: absolute;
background: rgba(0, 0, 0, 0.5);
border-radius: 5px;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
<div class="content">
<video id="player" src="https://upload.wikimedia.org/wikipedia/commons/transcoded/1/18/Big_Buck_Bunny_Trailer_1080p.ogv/Big_Buck_Bunny_Trailer_1080p.ogv.360p.vp9.webm" autoplay loop muted></video>
</div>
Here's an example that will center the content within the parent div. This also makes sure the overlay starts at the edge of the video, even when centered.
<div class="outer-container">
<div class="inner-container">
<div class="video-overlay">Bug Buck Bunny - Trailer</div>
<video id="player" src="https://wiki.yoctoproject.org/wiki/images/a/a6/Big-buck-bunny_trailer.webm" controls autoplay loop></video>
</div>
</div>
with css as
.outer-container {
border: 1px dotted black;
width: 100%;
height: 100%;
text-align: center;
}
.inner-container {
border: 1px solid black;
display: inline-block;
position: relative;
}
.video-overlay {
position: absolute;
left: 0px;
top: 0px;
margin: 10px;
padding: 5px 5px;
font-size: 20px;
font-family: Helvetica;
color: #FFF;
background-color: rgba(50, 50, 50, 0.3);
}
video {
width: 100%;
height: 100%;
}
here's the jsfiddle https://jsfiddle.net/dyrepk2x/2/
Hope that helps :)
There you go , i hope this helps
http://jsfiddle.net/kNMnr/
here is the CSS also
#video_box{
float:left;
}
#video_overlays {
position:absolute;
float:left;
width:640px;
min-height:370px;
background-color:#000;
z-index:300000;
}
<div id="video_box">
<div id="video_overlays"></div>
<div>
<video id="player" src="http://video.webmfiles.org/big-buck-bunny_trailer.webm" type="video/webm" onclick="this.play();">Your browser does not support this streaming content.</video>
</div>
</div>
for this you need to just add css like this:
#video_overlays {
position: absolute;
background-color: rgba(0, 0, 0, 0.46);
z-index: 2;
left: 0;
right: 0;
top: 0;
bottom: 0;
}
#video_box{position: relative;}