国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Problems after adding borders to css3 flex child elements
漂亮男人
漂亮男人 2017-05-16 13:27:46
0
2
1121

After the parent element is set to flex, the child elements {flex:0 0 33.3333%} can be divided into three equal parts in the same row,

But if a border is added to the child element, then only 2 can be arranged in the same row. If flex elastically expands, does the border width not be calculated?

漂亮男人
漂亮男人

reply all(2)
滿天的星座

Add

to the

child element
box-sizing: border-box;

The package does not include padding and borders, which are two box models, controlled by box-sizing
Reference: https://developer.mozilla.org...

phpcn_u1582

As long as you set flex-wrap: wrap; to flex, it will not stretch, and it will wrap when it exceeds the limit.

The solution is as shown on the first floor. Of course, you can also use the calc function to subtract the border value from the flex value (flex:0 0 calc(33.333% - 2px)),或者使用outline: 1px solid red;,outline是不會(huì)將寬度計(jì)算進(jìn)去的,你的這段代碼可以不用flex: 0 0 33.333%這樣寫,直接寫width:33.33%或者flex:33.33%.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template