首页 > 解决方案 > 如何将换行的文本与中心对齐

问题描述

我有一个h1元素被包裹在较小的屏幕中如何使用 css 使包裹的文本与中心对齐?

这就是我要的

welcome To our site, the no. 1 site
        to get all ur books

标签: htmlcss

解决方案


例如,h1 元素是 this <h1 class="heading">Welcome To our site, the no. 1 site to get all your books</h1>,将其添加到 css 中:.heading{text-align:center}


推荐阅读