html - 使用 CSS 垂直居中 3 个段落

标签 html css center

我只是个初学者。我设法将我的 div 水平居中,其中包含 3 个段落:

div p {
    text-align: right;
    margin-right: 50%;
    color: white;
}

如何让它们垂直对齐,文本右对齐?图片相关。

enter image description here

<div class="imperio">
    <p>Império<br>
    dos<br>
    Sabores</p>
</div>

最佳答案

div p {
text-align: center;
color: white;
}

关于html - 使用 CSS 垂直居中 3 个段落,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22153212/

相关文章:

html - 使用 Bootstrap 和 IE 修复垂直居中 div

javascript - 单击某个对象时获取该对象的位置

html - CSS - IE 显示不正确

css - Flexbox 未对齐

css - 有边界的绝对位置?

html - 宽度为 33.33% 的 3 个元素超过 100%?

javascript - 添加 href 以从 firestore 自动生成数据表

javascript - JS - 窗口宽度功能不起作用

css - 在我的导航中创建指示器槽口时出现 css 问题

html - float : right item? 上不存在的右边距