I am using box-sizing: border-box;
with varying border
thicknesses within a flexbox. I want the elements within the flexbox to have equal widths, b
your problem is here flex: 1;
change it to flex: 1 0 20%;
even for more/less elements. no need to calculate the width using calc
as others mentioned.
also just change this:
.container .block {
height: 28px;
flex: 1;
border: 1px solid black;
box-sizing: border-box;
}
to:
.container .block {
height: 28px;
flex: 1 0 20%;
border: 1px solid black;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
DEMO: https://jsfiddle.net/4aww81wv/