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
One way could be setting a 2px
padding to the .block
and removing it for .selected
.container {
display: flex;
flex-direction: row;
align-items: center;
width: 100px;
}
.container .block {
height: 28px;
flex: 1;
border: 1px solid black;
box-sizing: border-box;
padding: 2px;
}
.container .block.selected {
border: 3px solid blue;
padding: 0px;
}
0
1
2
3
4