I am currently working on designing a webpage layout where the header occupies 100% of the width and 20% of the height in conjunction with a left navbar (20% width) and a main body adjacent to it (80% width). Additionally, I want the page to be responsive so that it maintains its aspect ratio on screens of different sizes.
html
<!doctype html>
<html lang="en">
<head>
<title>Test</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="header">
</div>
<div class="left">
</div>
<div class="main">
</div>
</body>
</html>
In the CSS section below, you'll notice fixed properties are commented out. How can I achieve a responsive layout?
#header{
height:20%;
width:100%;
background-color: #3B3738;
/*min-height:80px;
min-width: 100%;*/
}
#left{
height:80%;
width:20%;
background-color: #848484;
/*min-height:550px;
min-width:20%;
position: relative;
float:left;*/
}
#main{
height:80%;
width:80%;
background-color: #FDF3E7;
/*min-height:550px;
min-width:80%;
position: relative;
float:left;*/
}