How do I center a div along the y axis
How do I center a div along the y axis
by sadika
HTML
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<div class="container-fluid" style="padding: 0px; margin: 0px;">
<ul id="contents" class="nav nav-pills">
<li>
<a href="#" id="productions">In Production</a>
</li>
<li class="pull-right">
<a href='#'>Contact</a>
</li>
<li class="pull-right">
<a href='#'>Portfolio</a>
</li>
<li class="pull-right">
<a href='#'>About</a>
</li>
<li class="pull-right">
<a href='#'>Home</a>
</li>
</ul>
<div id="home">
<div style="padding:25px;"></div>
<div class="block text-center">
<h1 class="homeHeading" style="width:auto;color:white;">Sandoval Labs Incorporated</h1>
<h3 id="homeHeading" style="color:white;">Developing</h3>
<div class="btnList">
<a class="btn btn-primary" href="#">Twitter</a>
<a class="btn btn-primary" href="#">Facebook</a>
<a class="btn btn-primary" href="#">Linkedin</a>
<a class="btn btn-primary" href="#">Github</a>
</div>
</div>
</div>
</div>
CSS
body{
font-family: "avenir";
font-weight:500;
margin:0px;
padding:0px;
}
.nav-pills{
font-family:arial;
font-size:2.0em;
background-color:black;
}
#productions{
font-family:Lobster;
}
#home{
/*background-image:url(snoopAndZuck.jpg);*/
background-image: url(http://lorempixel.com/1600/400/nature/);
background-size: cover;
background-position: center center;
background-repeat: no-repeat;
position: relative;
height:800px;
}
.btn-primary{
font-size:1.7em;
}
h1{
font-size: 4em;
}
.homeHeading{
margin:0 0 0 0;
padding:0px;
}
.block{
opacity:.7;
background-color: #000000;
padding:10px;
width:85%;
margin-left:auto;
margin-right:auto;
}
@media (max-width: 578px) {
.btnList a {
margin: 2px 0px;
}
}