gpt4 book ai didi

html - h1标题断成第二行时如何添加填充

转载 作者:太空宇宙 更新时间:2023-11-04 13:16:22 25 4
gpt4 key购买 nike

<分区>

我有一个宽度为 46% 的 div。有一个 h1 标签。当文本较长时,h1 标签的文本会被打断。但我想对第二行使用相同的左填充。

为了更好地理解,我附上了一张图片和 CSS。有没有解决办法。

这是HTML

<div class="header-tite">
<h1>An Epidemic 37 Years in the Making</h1>
</div>

这是CSS

.header-tite{
width:45%;
float:left;
position:absolute;
left:95px;
bottom:42px;
z-index:1;
}

.header-tite h1{
font-family: 'gotham_bookregular';
font-size:55px;
font-weight:normal;
color:#191919;
line-height:68px;
padding:0px 10px 0px 10px;
background:#FFFFFF;
display:inline;
opacity:0.85;
}

这里是输出

enter image description here

我想要 Y 之前的相同间隙。

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