I am trying to use the full height of the webpage. However, it only uses like 40% of the webpage's height. So, I looked up online and it said that I should use HTML, body {height: 100%}. So I used HTML, body {height: 100%} but it doesn't work. I tried to give 20% to header, 70% to section, and 10% to footer. However, I didn't do it because if I do that, my text won't vertically center. How can I do it?
<style>
* {
box-sizing: border-box;
border: 0;
}
html, body {
height: 100%;
}
header{
background-color: blue;
padding: 30px 0;
text-align: center;
font-size: 30px;
}
section {
display: flex;
}
nav, article {
border: solid 1px black;
clear: both;
background-color: aqua;
}
nav {
flex: 1;
padding: 20px;
background-color: darkslateblue;
}
article {
text-align: center;
padding: 10px;
flex: 4;
}
footer {
border: solid 1px black;
background-color: crimson;
padding: 10px;
text-align: center;
}
</style>
</head>
<body>
<header>hello!</header>
<section>
<nav>
<ul>
<li><a href="">1</a></li>
<li><a href="">2</a></li>
<li><a href="">3</a></li>
<li><a href="">4</a></li>
</ul>
</nav>
<article>
<h2>hello</h2>
<p>hello how are you?</p>
</article>
</section>
<footer>this is footer</footer>
</div>
</body>
</html>
in the blue area (.grid-header)? when I put text-aling: center, it only centers horizontally
– umklapper Jun 23 '21 at 19:47