html - 如何在悬停时更改按钮?

标签 html css

我需要帮助来创建鼠标悬停时的图像更改。我将此图像用作按钮。这是我的代码:

.button_home {
    width: 110px;
    height: 50px;
    background-image: url(background1.png);
}
.button_home :hover {
    background-image: url(background_ov1.png);
}

我的 html 是:

<form action="webpage.HTML">
<input type="image" class="button_home">
</form>

有什么帮助吗?

最佳答案

去掉:hover前的空格

.button_home:hover {

关于html - 如何在悬停时更改按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20601600/

相关文章:

css - Internet Explorer 7 中的@font-face 问题

Angular 2 中的 CSS 主题

javascript - 如何快速加载多个图像(没有 Css Sprites)

html - 我怎样才能让三个元素水平对齐?

javascript - 从html发送udp数据包到本地网络

javascript - jQuery Accordion - 访问时打开的第一个选项卡

css - LESS 无法识别的输入

iphone - 针对不同的移动设备分辨率进行设计,例如 iPhone 4 和 iPhone 3G

jquery - 使用索引号jquery检索值

php - 将下拉菜单回显到页面上