I have a sidebar that i need to be responsive depending on the viewport. Here is how it looks
I was wondering if there was a way to write one piece of code and some css without having to write different html for every device.
Here is what I wrote so far for desktop view
<div class="mycontainer">
<div>
<p>A</p>
<p>B</p>
</div>
<div>C</div>
<div>D</div>
</div>
<div>E</div>
<div>F</div>
<div>
<p>G</p>
<p>H</p>
</div>
</div>
the css:
.mycontainer{
width:194px;
height:291px;
border-radius: 8px;
box-shadow: 0px 3px 6px #00000029;
margin-left: 30px;
background: #FFF;
z-index:100;
}
.mycontainer div{
border-bottom: 1px solid #E5E5E5;
text-align: center;
}
.mycontainer div:first-child, .mycontainer div:nth-child(2){
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding: 10px 0;
}
.mycontainer div:nth-child(3), .mycontainer div:nth-child(4){
display: flex;
flex-direction: row;
align-items: center;
}
.mycontainer div:nth-child(5){
border: none;
}
Any help would be appreciated