我的问题的本质如下。我无法正确调整容器中文本的位置。我给了整个容器一个相对位置,以及所需的绝对文本块,但有些东西不起作用。应该是什么:
HTML:
<div class="osnova">
<p class="Title">Bring clarity to your team</p>
<p class="Bottom">Slite is a modern knowledge base that drives action with structured docs, thoughtful collaboration and
confident decision-making.</p>
</div>
CSS:
.osnova {
margin: 0 auto;
width: 900px;
position: relative;
}
.Title {
text-align: center;
margin: 50px;
font-size: 60px;
font-weight: 500;
}
.Bottom {
position: absolute;
text-align: center;
font-size: 18px;
font-weight: 500;
}
我不是 CSS 专家,所以写了这个技巧来减少文本宽度:
该方法可行,但适配其他设备时可能会出现问题。另一个缺点是对文本宽度的永久微调而不是普通方法。