我试图通过在a中定义提交按钮来替换提交按钮class="myButton"
并更改CSS中的样式.在myButton:active
似乎并不被点击时工作.
这是我的CSS:
.myButton{
background:url(./images/but.png) no-repeat;
cursor:pointer;
border:none;
width:100px;
height:100px;
}
myButton:active {
background:url(./images/but2.png) no-repeat;
}
Run Code Online (Sandbox Code Playgroud)
HTML代码:
<input class="myButton" type="submit" value="">
Run Code Online (Sandbox Code Playgroud)
Mr_*_*een 26
检查此链接.你失踪.
之前myButton
.这是一个小错误.:)
.myButton{
background:url(./images/but.png) no-repeat;
cursor:pointer;
border:none;
width:100px;
height:100px;
}
.myButton:active /* use Dot here */
{
background:url(./images/but2.png) no-repeat;
}
Run Code Online (Sandbox Code Playgroud)