gpt4 book ai didi

html -

标签内垂直对齐

转载 作者:太空宇宙 更新时间:2023-11-03 20:50:36 24 4
gpt4 key购买 nike

我有这个 html:

<div id="workAllocated">
<h3>Work Allocated</h3>
<p>Lorem Ipsum</p>
<p>Lorem Ipsum</p>
</div>

以及以下 CSS:

div#contentarea.profile_edit div {
margin-bottom: 20px;
}
div#contentarea.profile_edit div.col_01 h3 {
font-size: 2.4em;
margin: 0;
}
div#workAllocated p {
margin-bottom: 0px;
border-bottom: 1px solid red;
}

结果看起来像这个快照:

enter image description here

但我需要它看起来像这样:

enter image description here

不同的是 <p> 中文本的垂直对齐方式标签。它在 <p> 内左上对齐容器,但它应该是中间偏左的。我试过一些 tricks例如更改行高并将显示更改为表格单元格,然后应用垂直对齐属性,但它们都没有真正起作用。

提前致谢!

最佳答案

为您的 p 设置高度,然后将行高设置为等于该高度。

关于html - <p> 标签内垂直对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16442941/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com