如何将宽度设为父高的100%?

时间:2019-08-23 10:31:17

标签: css

我有css自适应弹性布局,我需要将其中的中央块设为正方形。 https://codepen.io/roskoshinsky/pen/pozRLJe但是,如果没有JS,我怎么能将此块的宽度设置为父级高度的100%?有可能吗?

.cells-field {
   .flex();
   .flex-container(row, wrap);
   .box-sizing(content-box);
   justify-content: flex-start;
   align-items: flex-start;
   width: 33vw; // ??? need 100% of parent height without JS
   background-color: lighten(@sColor2, 10%);
   border: lighten(@sColor1, 10%) 1px solid;
}

0 个答案:

没有答案
相关问题