这是我的HTML代码:
<button type="button">Team</button>
这是我的CSS代码:
.button {
background-color: #4CAF50;
position: absolute;
top: 100px;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
}
但在我的网站上只是一个简单的HTML按钮。我不明白为什么。我希望得到帮助...
您的 HTML 代码应该是:
<button type="button" class="button">Team</button>
或者 CSS 规则应该应用于任何按钮,如下所示:
button {
background-color: #4CAF50;
position: absolute;
top: 100px;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
}