这是一个flexbox解决方案.仅限IE11,除非您使用的是
shim.
.flex-container {
display: flex;
background: #eee;
margin: 0 auto;
flex: 1;
width: 100%;
}
.flex-container.vert {
flex-direction: column;
}
.flex-container.outer {
width: 30vw;
height: 30vw;
}
.flex-item {
background: tomato;
flex: 1;
}
.flex-item:nth-child(2n) {
background: pink;
}
.flex-item img {
width: 100%;
height: 100%;
}
.double {
flex: 2;
background: lightgreen;
}