gpt4 book ai didi

html - 在 CSS 中调整文本位置

转载 作者:行者123 更新时间:2023-12-05 08:35:53 24 4
gpt4 key购买 nike

我是 HTML 和 CSS 的新手,在调整文本位置时遇到问题。

这是我期望看到的:

但这是我实际得到的:

这是我的代码:

#box {
width: 330px;
height: 212px;
margin-top: 1px;
margin-left: 22.5px;
background-color: orange;
}

#box topic {
font-size: var(--text-big);
font-family: myFirstFont;
margin-top: 20px;
margin-top: 20px;
}
<section id=box>
<topic>XXX</topic>
</section>

最佳答案

您可以将此行添加到您的框类中以将其存档。

  border-radius:10px;
padding: 10px 8px;
box-sizing: border-box;

#box {
width: 330px;
height: 212px;
margin-top: 1px;
margin-left: 22.5px;
background-color: orange;
border-radius:10px;
padding: 10px 8px;
box-sizing: border-box;
}

#box topic {
font-size: var(--text-big);
font-family: myFirstFont;
margin-top: 20px;
margin-top: 20px;
}
<section id="box">
<topic>XXX</topic>
</section>

关于html - 在 CSS 中调整文本位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71588607/

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