This is an increasingly common layout that can be relatively easily achieved with flexbox and some smart container layout.
. , 30px, , margin-right: 30px , nth-of-type margin-right .
, . , nth-of-type, , . /p >
, . , div ( 90%) overflow: hidden, 100% ; width: calc(100% + 30px). , , , .
, , flex- , , ; .third { flex: 0 0 calc(33.33% - 30px); /* for a 1/3 tile */}
:
* {
box-sizing: border-box;
}
.tile-wrapper {
display: block;
position: relative;
width: 90%;
margin: 0 auto;
overflow: hidden;
}
.tile-container {
display: flex;
position: relative;
width: calc(100% + 30px);
flex-wrap: wrap;
}
.tile {
display: inline-block;
margin-right: 30px;
margin-bottom: 30px;
min-height: 200px;
line-height: 199px;
text-align: center;
border: 1px solid black;
}
.two-thirds {
flex: 0 0 calc(66.66% - 30px);
}
.third {
flex: 0 0 calc(33.33% - 30px);
}
.sixth {
flex: 0 0 calc(16.66% - 30px);
}
.. (Chrome, Safari, FF, IE11 +). IE11, flex-basis, calc().