Currently, I'm working on designing a layout without relying on grid or flexbox. Instead, I am utilizing display: inline-block
to accomplish this task, but I am facing challenges with adjusting spaces.
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
.wrapper {
text-align : justify;
}
.wrapper > div {
display: block;
margin-top: 5px;
}
.header {
background: lightgreen;
margin-top: 0;
}
.footer {
background: #eee;
}
.main > div {
display: inline-block;
width: 49%;
height: 20vh;
background: #eee;
}
<div class="wrapper">
<div class="header">header</div>
<div class="main">
<div class="item">item1</div>
<div class="item">item2</div>
<div class="item">item3</div>
<div class="item">item4</div>
</div>
<div class="footer">footer</div>
</div>
I am attempting to replicate the same effect as justify-content: space-between
in flexbox, however, some elements are not aligning properly within the layout.
To adjust the spacing around item4, I can use margin-left
, but I am searching for a more elegant solution.