关于如何让div或者view中的文字水平垂直居中的常见的两种方式
a.
div{
width: 200px;
height: 200px;
text-align: center; //水平居中
line-height: 200px; //垂直居中
}
b.巧用display
div {
width: 200px;
height: 200px;
display: flex;
justify-content: center; //水平居中
align-items: center; //垂直居中
}
身是红尘雨中客,
愿有执伞并肩人.