这种情况下,子元素多行文字如何垂直居中?-灵析社区

我是张工你呢

这种情况下,子元素多行文字如何垂直居中? Document .box1 { width: 100px; height: 300px; border: 1px solid red; word-wrap: break-word; } .box { display: flex; align-items: center; height: 500px; border: 1px solid blue; } 1234aaaaaaaaaaaaaaaaaaaaa ![](https://wmprod.oss-cn-shanghai.aliyuncs.com/c/user/20240925/fcef9055cae8d4f129ee344ecb5e00cc.png)

阅读量:168

点赞量:1

问AI
应该是最帅的鹅
align-items: center;垂直居中,word-break:break-all;字母数字换行 .box1{ width: 100px; height: 300px; border: 1px solid red; display: flex; align-items: center; word-break:break-all; }