JSFiddle - React, Tailwind, and code Playground
by Gwyn Milcote
HTML
<div class='mainpage'>
<div class='nav'>
<div class='nav_link'>hh</div>
<div class='nav_link'>hh</div>
<div class='nav_link'>hh</div>
<div class='nav_link'>hh</div>
<div class='nav_link'>hh</div>
</div>
<div class='article'>
Content
</div>
</div>
CSS
html,
body {
margin: 0;
height: 100%;
}
* {box-sizing:border-box;}
.header {
position: fixed;
z-index: 2;
top: 0;
left: 0;
width: 100%;
height: 50px;
background-image: url(https://images.pexels.com/photos/159020/sunset-sky-afterglow-evening-sky-159020.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500);
padding: 10px;
display: flex;
flex-direction: row;
justify-content: space-between;
}
.nav {
position: fixed;
z-index: 1;
top: 50px;
left: 0;
width: 200px;
height: calc(100% - 20px);
background-image: url(https://images.pexels.com/photos/159020/sunset-sky-afterglow-evening-sky-159020.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500);
border-right: 1px solid #d9d9d9;
overflow: auto;
}
.nav_link {border:1px solid red;padding:5px;margin:5px;}
.mainpage {
width: 100%;
position: relative;
top: 50px;
display: flex;
flex-direction: row;
}
.article {
background: #F3F3F5;
position: relative;
top: 0px;
left: 200px;
width: calc(100% - 200px);
height: 2000px;
padding: 10px;
background-image: url('http://griffusion.elementfx.com/pics/ui/bg-day.jpg');
background-attachment: fixed;
}
@media (max-width: 800px) {
.nav {width: 150px;}
.article {width: calc(100% - 150px);left:150px;}
}
@media (max-width: 600px) {
.nav {
width: 100%;
height: 50px;
max-height: 100px;
text-align: center;
}
.nav_link {
display: inline-block;
}
.mainpage {flex-direction: column;}
.article {
width:100%;
position: relative;
top: 50px;
left: 0;
}
}