okey Asked:2022-03-18 01:49:15 +0000 UTC2022-03-18 01:49:15 +0000 UTC 2022-03-18 01:49:15 +0000 UTC 怎么让背景中的文字居中,纵横? 772 这是一个矩形,文本在垂直和水平方向都在中间。不要告诉我该怎么做? .row{ width: 100%; font-family: calibri; background-color: #blue; text-align: center; color: white; height: 100px; margin: 30px 0px 0px 0px; } <div class="row"> <h1>Текст</h1> </div> html 1 个回答 Voted Best Answer user347472 2022-03-18T01:54:59Z2022-03-18T01:54:59Z 有很多方法,比如: .row{ width: 100%; font-family: calibri; background-color: blue; color: white; height: 100px; margin: 30px 0px 0px 0px; display: flex; justify-content: center; align-items: center; } <div class="row"> <h1>Текст</h1> </div> 一般来说,输入谷歌css vertical align,你会找到一堆例子。
有很多方法,比如:
一般来说,输入谷歌
css vertical align,你会找到一堆例子。