简体   繁体   English

悬停在表单提交按钮上?

[英]Underline Hover on Form Submit Button?

How can I make a hover state, preferably underline, with a Form submit button? 如何使用“表单提交”按钮使鼠标悬停状态(最好是下划线)?

..or would it be easier to incorporate a simple JavaScript Img rollover - Ultimately I just need a hover underline state to assure the user the area is click-able. ..或合并简单的JavaScript Img过渡会更容易-最终,我只需要将鼠标悬停在下划线状态即可确保用户可点击该区域。

Update: Currently have; 更新:目前有;

<input type="submit" onClick="javascript:validForm();" value="SUBMIT" class="subbtn" >




input.subbtn {

    width: 75px;
    height: 32px;
    background-color:#F00;
    font-family:Arial, Helvetica;
    color:#fff;
    border: 0px;
    font-weight: bold;
    font-size:14px;
}


input.subbtn:hover
{
/* when hover (mouse over)*/
    text-decoration:underline;
}

Why isn't this working; 为什么这不起作用? and why does it make it so the little clickable hand isn't displayed anywhere - so the users know even less that the area is clickable. 以及为什么要这样做,以致于点按的小手不会在任何地方显示-因此用户甚至更不知道该区域是可点击的。

I just want a hover underline, what am I missing? 我只想要一个悬停的下划线,我想念的是什么?

You can use css to style the buttons, no javascript needed. 您可以使用CSS设置按钮样式,而无需使用javascript。 Make it a normal button: 使其成为普通按钮:

<input type="button" class="button" onClick="javascript:validForm();">

And css: 和CSS:

input.button
{
/* style it*/
}

input.button:hover
{
/* when hover (mouse over)*/
    cursor:hand;
}

try without ".button" this will apply to all the inputs on oyur page, maybe you must add an "ID".. or maybe not.. 尝试不带“ .button”,这将适用于您页面上的所有输入,也许您必须添加一个“ ID” ..或不。

input {

}

input:hover
{
    cursor:hand;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM