我试图让我的按钮1)变成红色,并且2)在悬停/鼠标悬停时变成绿色。 这里是我的HTML:为什么我的按钮不是我说的那种颜色?
<div id="home-button"> <button type="button" style="height: 100px; width: 400px; font-size: 45px; font-family: 'Josefin Sans', sans-serif; border-radius:20px" href='/'> HOME </button> </div>
这里是我的CSS:
#home-button {
text-align: center;
padding:10px;
color: red;
}
#home-button:hover {
background-color: green;
}
正如你所看到的,按钮既不是红色也不绿色。请告诉我为什么
非常感谢您的帮助和快速响应! –
@SydneyPenny,很高兴帮助:) – AmmarCSE