简体   繁体   English

onclick按钮边框颜色更改

[英]onclick button border color change

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. 什么也没发生,因此很难说出您是否单击了鼠标或发生了什么。

How do you change the "onclick" border color? 如何更改“ onclick”边框颜色? That way, it can get that "depressed" look again. 这样,它可以再次获得“沮丧”的外观。

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

The best solution is to use css, try the following code: 最好的解决方案是使用CSS,请尝试以下代码:

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

Hope that helps! 希望有帮助!

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

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