我需要将屏幕右侧的两个p标签进行列对齐,如下面的代码所示:
.divsignature{
font-weight: bold;
float:right;
}
.signature{
padding: 15px 30px 10px 0px;
}
<div class="divsignature">
<p class="signaturetext">Signature for acceptance</p>
<p class="signature">__________________________________</p>
</div>
但我希望“接受签名”位于下面一行的中心,即带有类签名的 p 标签。
有人可以帮助我吗?
最佳答案
使用这个;
.divsignature{
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
font-weight: bold;
float: right;
}
/* Remove the .signature padding */
或
.divsignature {
text-align: center;
font-weight: bold;
}
.signaturetext {
text-align: center;
}
/* Remove the .signature padding */
哪个最适合您。
关于html - 如何将第一个 p 标签放在其下面的第二个 p 标签的中间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75076382/