onclick按钮边框颜色更改 [英] onclick button border color change

查看:322
本文介绍了onclick按钮边框颜色更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

应该很简单,但是我迷路了,所有搜索都导致与我的问题不直接相关的非特定答案.

Should be fairly simple but I'm lost and all searches result in non-specific answers that don't directly relate to my issue.

按钮的边框是黑色的,但是显然,沮丧"的感觉是通过将边框的颜色更改为黑色来实现的,因此当我单击按钮时,感觉是死的".什么都没发生,所以很难说出您是否单击了鼠标或发生了什么.

Button, border is black but apparently, the "depressed" feel is achieved by changing the border color to black so when I do click the button, it feels "dead". Nothing happens, so it's hard to tell if you miss-clicked or what.

如何更改"onclick"边框颜色?这样,它可以再次获得沮丧"的外观.

How do you change the "onclick" border color? That way, it can get that "depressed" look again.

.addButton {
border-color:black;
border-width:1px;
background-color:#00B0F0;
text-decoration:underline;
}

推荐答案

最好的解决方案是使用CSS,请尝试以下代码:

The best solution is to use css, try the following code:

 .addButton:active, 
 .addButton:focus 
 {
     border:0.5em solid #00c; /* here configure as your needs */
     color:#00c;
  }

希望有帮助!

这篇关于onclick按钮边框颜色更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆