css-algin-context-vertical
RUN
<!DOCTYPE html> <html> <head> <style> .center { line-height: 200px; height: 200px; border: 2px solid red; text-align: center; } .center p { line-height: 1.5; display: inline-block; vertical-align: middle; } </style> </head> <body> <div class="center"> <p>Đây là phần tử p có nội dung căn giữa theo chiều dọc</p> </div> </body> </html>
PHÓNG TO