我需要将屏幕右侧的两个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>
但是我希望"Signature for acceptance"的字样相对于下面一行位于中间,即相对于带有类签名的p标记。
有谁能帮帮我吗?
4条答案
按热度按时间lymnna711#
用这个;
或
哪个对你最合适。
jecbmhm32#
你可以修改容器(主体)并使用flex。我从px修改而来,所以如果你缩放空间的话,可以使用flex。
这里是一个潜在的替代使用网格,没有文字的行只是一个边界;空间可以改变字体大小等。在CSS中的相关有趣的事情的评论。
一个二个一个一个
beq87vna3#
使用
text-align: center;
可以将其存档。xkrw2x1b4#