flex佈局:左側內容隨右側內容高度自適應等高

css:

。box{ display: flex; width:1000px; } 。l{ display: flex; background: pink; width: 700px; /*根據具體情況使用*/ } 。r{ width: 300px; background: orange; } 。autoHWCenter { display: -webkit-box; display: -ms-flexbox; display: -webkit-flex; display: flex; -webkit-box-pack: center; -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; -webkit-box-align: center; -ms-flex-align: center; -webkit-align-items: center; align-items: center; }

HTML:

這邊的盒子高度隨著右邊盒子的高度自適應與其等高。 且內容文字垂直左右居中顯示
Do not hesitate to do anything u thing meaningful。 Do not hesitate to do anything u thing meaningful。 Do not hesitate to do anything u thing meaningful。 Do not hesitate to do anything u thing meaningful。 Do not hesitate to do anything u thing meaningful。

效果:

flex佈局:左側內容隨右側內容高度自適應等高