inline-block元素因基线对齐而造成上浮的问题
假设我需要实现将三个块级元素并排对齐的如下效果: 代码如下: 1 <!DOCTYPE html> 2 <html lang="en-US"> 3 <head> 4 <style> 5 .container { 6 display: inline-block; 7 margin: 15px; 8 padding: 5px; 9 width: 200px; 10 height: 200px; 11 border: 1px solid black; 12 } 13 </style> 14 </head> 15 16 <body> 17 18 <div style="margin: 200px;"> 19 <div class="container"> 20 <h2>Title</h2> 21 <p>One One One One</p> 22 </div> 23 24 <div class="container"> 25 <h2>Title</h2> 26 <p>Two Two Two Two</p> 27 </div> 28 29 <div class="container"> 30 <h2>Title</h2> 31 <p>Three Three Three Three</p> 32 </div> 33 </div> 34 35 </body> 36 </html> 然而