Hello All I am trying to move a4 to the area shown in the img but i cant find how or any related posts on how to get 2 divs to the right of the 1 div, Any and all help is appreciated. Thanks!
This is what it should look like:
What It Should Look Like:
Here is the code that I have tried:
.post-background {
width: 100%;
text-align: center;
padding-top: 100px;
padding-bottom: 100px;
display: flex;
align-items: center;
justify-content: center;
}
.post-area {
width: 80%;
height: 500px;
background: rgba(128, 0, 128, 0.1);
display: block;
border: 5px solid purple;
}
.a1 {
text-align: center;
width: 99.2%;
height: 75px;
background: rgba(255, 0, 0, 0.5);
border: 5px solid red;
display: block;
}
.a2 {
text-align: center;
width: 70%;
height: 200px;
background: rgba(0 0, 255, 0.5);
border: 5px solid blue;
display: inline-block;
}
.a3 {
text-align: center;
width: 20%;
height: 75px;
background: rgba(0 255, 0, 0.5);
border: 5px solid green;
display: inline-block;
margin-left: 8%;
}
.a4 {
text-align: center;
width: 20%;
height: 75px;
background: rgba(0, 229, 255, 0.5);
border: 5px solid rgb(0, 229, 255);
display: inline-block;
margin-left: 8%;
}
<div class="post-background">
<div class="post-area">
<div class="a1">
<h1>a1</h1>
</div>
<div class="a2">
<h1>a2</h1>
</div>
<div class="a3">
<h1>a3</h1>
</div>
<div class="a4">
<h1>a4</h1>
</div>
</div>
</div>
3
Answers
Grid is best for two-dimensional layouts.
You can try this approach :