I struggle to make my header be 85% of the screen height and the following red bar being the rest 15%, please tell my what did I do wrong and how can I make this happen:)
Thank you for the responses, could you guys tell me why when I reduce the height the content of header overlaps with the red bar and how can i solve that?
Here is the code: https://jsfiddle.net/v0bk9u3v/
<header>
<a href="#"><img src="#" class="logo"></a>
<ul class="navbar">
<li><a href="#">Lorem</a></li>
<li><a href="#">Lorem</a></li>
<li><a href="#">Lorem</a></li>
<li><a href="#">Lorem</a></li>
</ul>
<div class="headline">
<h1>Lorem</h1>
<div class="desc">
Lorem ipsum dolor sit amet, et denique molestiae sit. Alia mediocrem ei mei, recusabo repudiandae mel et.
</div>
</div>
<a href="#" class="button b1">Lorem ipsum</a>
</header>
<div class="lorem">
<h2>Lorem ipsum</h2>
<p>Lorem ipsum dolor sit amet, et denique molestiae sit. </p>
<a class="button" href="#">Lorem ipsum</a>
</div>
*
{
margin: 0;
padding: 0;
}
.headline h1
{
line-height: 85%;
font-size: 7em;
color: #ffffff;
width: 5em;
margin-left: 5vh;
text-transform: uppercase;
padding-top: 2em;
}
.navbar
{
padding-top: 1em;
padding-right: 3em;
float: right;
text-transform: uppercase;
list-style-type: none;
display: inline;
}
.navbar li
{
float: left;
}
.navbar li a
{
font-size: 0.9em;
display: block;
text-align: center;
padding: 0.8em;
text-decoration: none;
color: #ffffff;
}
.logo
{
width: 15em;
padding: 1.5em 2em 2em 5vh;
float: left;
}
.b1
{
margin-left: 5vh;
font-size: 0.9em;
letter-spacing: 0.1em;
padding: 1.3em 2.8em;
margin-top: 1em;
}
.button
{
z-index: 1;
display: inline-block;
color: #ffffff;
text-decoration: none;
text-transform: uppercase;
border: solid 1px #ffffff;
position: relative;
transition: color 0.2s ease-in;
}
.button:before
{
z-index: -1;
content: '';
position: absolute;
top: 0px;
left: 0px;
height: 100%;
width: 100%;
max-height: 0%;
background: #ffffff;
transition: all 0.1s ease-in;
}
.button:hover
{
color:#d00807;
}
.button:hover:before
{
max-height: 100%;
}
.desc
{
color: #ffffff;
width: 25em;
font-size: 1.2em;
padding: 2em 0em 2em 5vh;
}
header
{
background-image: linear-gradient(rgba(0,0,0,0.5),rgba(0,0,0,0.1)),url(#);
background-position: center;
background-size: cover;
}
.lorem,.lorem h2,.lorem p,.lorem a
{
overflow: hidden;
}
.lorem
{
background-color:#d00807;
color: #ffffff;
}
.lorem h2
{
font-size: 1.7em;
text-transform: uppercase;
display: inline-block;
text-align: center;
position: relative;
}
.lorem p
{
font-size: 1em;
display: inline-block;
text-align: center;
position: relative;
}
.lorem a
{
font-size: 0.9em;
letter-spacing: 0.1em;
padding: 1.5em 1.5em;
position: relative;
}
@media screen and (min-width: 1000px)
{
.lorem
{
padding: 2.2em 2em;
}
.lorem h2
{
float: left;
width: 10em;
font-size: 2.3em;
}
.lorem a
{
float: right;
margin-right: 1em;
margin-top: 1em;
}
.lorem p
{
margin-left: 1em;
font-size: 0.9em;
padding-top: 1.5em;
width: 26vw;
}
}
@media screen and (max-width: 1000px) and (min-width: 750px)
{
.lorem
{
padding: 2.2em 2em;
}
.lorem h2
{
font-size: 2em;
}
.lorem h2,.lorem p
{
display: block;
text-align: left;
width: 50vw;
}
.lorem a
{
float: right;
margin-right: 1em;
margin-top: -4em;
}
}
@media only screen and (max-width: 750px)
{
.lorem
{
padding: 5em 7em;
}
.lorem h2
{
padding-bottom: 0.3em;
display: block;
font-size: 1.5em;
text-align: center;
}
.lorem p
{
font-size: 0.9em;
display: block;
}
.lorem a
{
text-align: center;
display:block;
margin-top: 1em;
}
.logo
{
width: 25em;
display: block;
margin: 0 auto;
float:none;
}
.navbar
{
text-align: center;
position: relative;
justify-content: center;
float: none;
display: block;
}
.navbar li
{
float: none;
display: inline-block;
}
.headline h1
{
font-size: 5.2em;
}
.desc
{
font-size: 1.1em;
}
.navbar li a
{
font-size: 1em;
}
}