use the mapping table to set it next to each other and keep it close and react.
display: table;with table-layout: fixed;will create a fluid layout for children withdisplay: table-cell;
this will not only keep them the same width, but also keep containers of the same height.
vertical-align: top; , middle bottom .
.
#wrapper {
max-width: 1050px;
margin: 60px auto 60px auto;
background-color: #DDD
}
#outer {
display: table;
width: 100%;
table-layout: fixed;
}
.itemwrapper {
display: table-cell;
vertical-align: top;
width: 100%;
}
img {
max-width: 100%;
height: auto;
}
<div id="wrapper">
<div id="outer">
<div class="itemwrapper">
<img src="item2.jpg" alt="bag" />
</div>
<div class="itemwrapper">
<img src="item3.jpg" alt="pen" />
</div>
</div>
</div>
Hide result