我可以让它垂直或水平居中,但不能同时居中。这是我到目前为止拥有的css代码:
.my-flex{
display: flex;
height: 100%;
width: 100%
}
//other pieces of the the flexbox that i have before it that aren't relevent
.last-element{
flex-grow: 1 0 auto;
align-self: center;
justify-self:center;
}
我还尝试让my-flex成为jusify-content center和flex-start