留下的疑問:這種佈局中的文字如何垂直居中,高度未知,並且是flex佈局html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <style> *{ margin: 0; padding: 0; } .wrapper{ display: flex; width: 1000px; height: 300px; } .item{ flex:1; border: 1px solid red; text-align: center; } .item.percent15{ flex:0 0 15%; } </style> <body> <div class="wrapper"> <div class="item percent15"> 百分15 </div> <div class="item"> 自適應 </div> <div class="item"> 自適應 </div> <div class="item percent15"> 百分15 </div> </div> </body> </html>