这是一个简单的问题。我一定是错过了答案。我有一个Flex容器,里面有一个flex项目。我希望弹性项目的宽度为90%,并且垂直和水平居中。我只是不能让它达到90%宽。我很困惑。这是我的代码:
<div class="" id="popupContainer">
<div class="flex-item-popup" id="popup">
</div>
</div>
#popupContainer {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
display:flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
align-content: flex-start;
align-items: center;
}
#popup {
width: 90%;
height: 90%;
flex-grow: 1;
flex-shrink: 0;
flex-basis: 200px;
justify-content: center;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -ms-flexbox;
display: flex;
-webkit-flex-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
background-color: black;
justify-content: center; /* align horizontal */
align-items: center; /* align vertical */
}