div中文本居中对齐后,然后再左对齐
如下效果:
========================
=======22345645==========
=======2345678987654=====
=======12================
=========================
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style> .container { text-align: center; /* 首先将文本居中 */ } .content { display: inline-block; /* 使内容水平居中 */ text-align: left; /* 然后将内容左对齐 */ } </style> </head> <body> <div class="container"> <div class="content"> <p>这是要居中然后左对齐的文本。</p> </div> </div> </body> </html>
标签:居中,vue,text,align,对齐,文本 From: https://www.cnblogs.com/51python/p/18058749