gpt4 book ai didi

html - 尝试为我的网站创建一个按钮

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

我正在尝试为我的网站创建一个按钮。这是我的代码:

CSS:

.fheader-text {
text-align: center;
}

.fheader-text h3 {
font-family: Arial;
color: #ffffff;
font-size: 30px;
background: #8edd63;
padding: 10px 20px 10px 20px;
text-decoration: none;
}

HTML:

<div class="fheader-text">
<h3>Aphryv</h3>
</div>

问题是背景宽度是 100%。我不能用 width: 50px 或类似的东西来改变它。

最佳答案

<div>占用所有空间,将其设为 <span>反而。之后,您可以设置所需的宽度。

关于html - 尝试为我的网站创建一个按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31462512/

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