I'm trying to create a page that has multiple 3 divs in a row, which are left right and center aligned.
I tried using float:left
and float:right
but it worked out really bad. The page scales super randomly and I want the divs to become in 2 columns when the page scales down and then to 1 column for mobile devices.
.container {
display: inline-block;
text-align: center;
width: 100%;
position: relative;
}
.left,
.middle,
.right {
width: 200px;
height: 200px;
background-color: red;
display: inline-block;
}
.left {
float: left;
}
.right {
float: right;
}
<div class="container">
<div class="left">
<div class="content">
</div>
</div>
<div class="middle">
<div class="content">
</div>
</div>
<div class="right">
<div class="content">
</div>
</div>
</div>
jsFiddle: https://jsfiddle.net/azizn/j4cgef5g/