Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 单击按钮后,按钮仍处于按下状态_Html_Css_Less_Frontend_Web Frontend - Fatal编程技术网

Html 单击按钮后,按钮仍处于按下状态

Html 单击按钮后,按钮仍处于按下状态,html,css,less,frontend,web-frontend,Html,Css,Less,Frontend,Web Frontend,我正在开发可重复使用的按钮。我面临的问题是,按钮在被点击后并没有得到它原来的样式。以下是LESS文件中的快照: .some-company-primary-button { .material; color: @some-company-primary-button-text-color; background: @some-company-primary-button-color; &:hover, &:focus, &:active,

我正在开发可重复使用的按钮。我面临的问题是,按钮在被点击后并没有得到它原来的样式。以下是LESS文件中的快照:

.some-company-primary-button {
  .material;

  color: @some-company-primary-button-text-color;
  background: @some-company-primary-button-color;

  &:hover,
  &:focus,
  &:active,
  &.focus,
  &.active {
    color: @some-company-primary-button-text-color;
    background: @some-company-primary-button-hover-color;
  }
}
谢谢你的建议

编辑我将其用于引导
btn

假设您的意思是“在单击其他内容之前不获取其原始样式”:

更改
:焦点
规则


单击某个控件将为其提供焦点,直到其他对象将焦点移动到其他位置。

我会尝试。但是
悬停
聚焦
之间的样式有什么区别呢?正如我在Bootstrap源代码中看到的,它们也使用
focus
event.tnx,我将看一看。但我的意思是smth就像一个成熟的前端人的观点:)他们之间的差异不是观点的问题。好吧,观点不是一个合适的词,反正tnx