I'm just starting out with HTML and CSS for website design and I want to create a layout similar to the one shown below:
https://i.sstatic.net/u5ill.png
In the image above, you can see that the page includes a header with a logo, and two boxes that overlap slightly. However, when I tried to implement this design, I ran into issues when resizing the screen. The squares didn't adjust properly on different screen sizes.
Here is the code that I've experimented with:
.header {
position: absolute;
width: 100%;
min-height: 18rem;
left: 0;
top: 0;
background: #F1E579;
}
.logo {
font-size: 350%;
font-family: Above;
margin-left: 3rem;
margin-top: 2.75rem;
}
.box1 {
position: absolute;
width: 37rem;
min-height: 40rem;
left: 7.8rem;
top: 12.3rem;
background: #FFFFFF;
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
border-radius: 10px;
}
.box2 {
position: absolute;
width: 42rem;
min-height: 45rem;
left: 44rem;
top: 10rem;
background: #FFFFFF;
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
border-radius: 10px;
}
<div class="container">
<div class="header">
<div class="logo">LOGO</div>
</div>
<div class="box1"></div>
<div class="box2"></div>
</div>