作者:mobiledu2502937981 | 来源:互联网 | 2023-01-31 12:40
我只想要文字如下:
display: table-cell;
vertical-align: middle;
但使用柔性盒
div {
border: 1px solid black;
}
.box {
display: flex;
flex-flow: column nowrap;
justify-content: center;
align-content: center;
align-items: stretch;
height: 200px;
}
.box div {
order: 1;
flex: 0 1 auto;
align-self: auto;
min-width: 0;
min-height: auto;
}
.box div.C {
flex: 1 1 auto;
}
1> Michael_B..:
div {
border: 1px solid black;
}
.box {
display: flex;
flex-flow: column nowrap;
justify-content: center;
align-content: center;
align-items: stretch;
height: 200px;
}
.box div {
order: 1;
flex: 0 1 auto;
align-self: auto;
min-width: 0;
min-height: auto;
display: flex; /* NEW */
align-items: center; /* NEW */
}
.box div.C {
flex: 1 1 auto;
}