Create a div with 100% height using only css
Code for creating a div with 100% height using only css. use this simple code to create a div with 100% height.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>code360network</title>
<style>
* {
box-sizing: border-box;
}
body {
margin: 0;
font-weight: 500;
font-family: 'HelveticaNeue';
}
section {
width: 100%;
padding: 0 7%;
display: table;
margin: 0;
max-width: none;
background-color: #373B44;
height: 100vh;
}
.intro {
height: 100vh; background:#000;
}
.content {
display: table-cell;
vertical-align: middle;
}
h1 {
font-size: 3em;
display: block;
color: white;
font-weight: 300;
}
p {
font-size: 1.5em;
font-weight: 500;
color: #C3CAD9;
}
a {
font-weight: 700;
color: #373B44;
position: relative;
}
footer {
padding: 1% 5%;
text-align:center;
background-color: #373B44;
color: white;
}
</style>
</head>
<body>
<section class="intro">
<div class="content">
<h1>You can create full screen sections without javascript.</h1>
<p>www.code360network.com</p>
</div>
</section>
<section>
<div class="content">
<h1>Resize your browser and see how they adapt.</h1>
</div>
</section>
<section>
<div class="content">
<h1>It's amazing and fast.</h1>
</div>
</section>
<section>
<div class="content">
<h1>www.code360network.com</h1>
</div>
</section>
<footer>
Made by code360network
</footer>
</body>
</html>
