Helo.
I have implemented a video background to a div on my website.
As you will see from the code below it´s in a div class called main. I would like to add a grid layout within this div to add my content.
But as you see, the logo is placing itselfe below the background and not as content with the video as a background.
What am I doing wrong? Hope someone can help.
Here´s my HTML:
Her´s my CSS
Here´s my RESET
I have implemented a video background to a div on my website.
As you will see from the code below it´s in a div class called main. I would like to add a grid layout within this div to add my content.
But as you see, the logo is placing itselfe below the background and not as content with the video as a background.
What am I doing wrong? Hope someone can help.
Here´s my HTML:
HTML:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>RS Design</title>
<link rel="stylesheet" href="css/reset.css" media="screen" />
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<div class="container">
<div class="header">
<div class="nav">
<div class="topBotomBordersOut">
<a href="#">HOME</a>
<a href="#">SERVICES</a>
<a href="#">ABOUT</a>
<a href="#">CONTACT</a>
</div>
</div>
</div>
<div class="main">
<video id="background-video" autoplay loop muted>
<source src="video/animated_bg_2.mp4" type="video/mp4">
</video>
<div class="main-left">
<img src="images/logo.png" width="436" height="281" alt=""/>
</div>
</div>
<div class="footer">
</div>
</div>
</body>
</html>
Her´s my CSS
CSS:
.container {
display: flex;
flex-direction: column;
min-height: 100vh;
}
.header {
width: 100%;
position: absolute;
background-color: rgba(27,61,95,0.85);
height: 35px;
line-height: 35px;
border-bottom: 3px solid #c3944b;
}
.main {
flex-grow: 1;
margin-left: auto;
margin-right: auto;
max-width: 1920px;
padding-left: 20px;
}
.footer {
border-top: 3px solid #c3944b;
background-color: #314c68;
height: 250px;
}
/* NAV */
.nav{
margin: auto;
max-width: 1920px;
}
.nav a {
color: #FFF;
text-decoration: none;
font: 14px Raleway;
margin: 0px 0px 0px 20px;
padding: 10px 10px;
position: relative;
z-index: 0;
cursor: pointer;
}
/* NAV ANIMATION */
.topBotomBordersOut a:before, div.topBotomBordersOut a:after
{
position: absolute;
left: 0px;
width: 100%;
height: 2px;
background: #c3944b;
content: "";
opacity: 0;
transition: all 0.3s;
}
div.topBotomBordersOut a:before
{
top: 6px;
transform: translateY(10px);
}
div.topBotomBordersOut a:after
{
bottom: 7px;
transform: translateY(-10px);
}
div.topBotomBordersOut a:hover:before, div.topBotomBordersOut a:hover:after
{
opacity: 1;
transform: translateY(0px);
}
/* BACKGROUND */
#background-video {
margin-top: 0px;
align: right;
z-index: -1;
}
Here´s my RESET
CSS:
@import 'https://fonts.googleapis.com/css?family=Raleway';
*,
*::before,
*::after {
box-sizing: border-box;
}
* {
margin: 0;
padding: 0;
font: inherit;
}
html {
box-sizing: border-box;
font-size: 16px;
color-scheme: dark light;
}
body, h1, h2, h3, h4, h5, h6, p, ol, ul {
height: 100%;
margin: 0;
padding: 0;
font-family: 'Raleway', sans-serif;
color: #FFFFFF;
background-color: #e0e2e4;
min-height: 100vh;
line-height: 1.5;
-webkit-font-smoothing: antialiased;
}
h1{
font-weight: bold;
font-size: 4rem;
line-height: 1;
}
h2{
font-weight: bold;
font-size: 2rem;
line-height: 1;
}
h3{
font-weight: bold;
font-size: 2rem;
font-style: italic;
line-height: 1;
}
a:link { text-decoration: none; }
a:visited { text-decoration: none; }
a:hover { text-decoration: none; }
a:active { text-decoration: none; }
h1{
font-weight: bold;
font-size: 4rem;
line-height: 1;
}
h2{
font-weight: bold;
font-size: 2rem;
line-height: 1;
}
h3{
font-weight: bold;
font-size: 2rem;
font-style: italic;
line-height: 1;
}
/* responsive images/videos */
img, picture, svg, video {
display: block;
max-width: 100%;
}
p, h1, h2, h3, h4, h5, h6 {
overflow-wrap: break-word;
}
ol, ul {
list-style: none;
}
a {
text-decoration: none;
}
input, button, textarea, select {
font: inherit;
-webkit-user-select: auto;
}
input, button, textarea, select {
font: inherit;
}