【发布时间】:2016-09-22 21:01:55
【问题描述】:
当按钮处于活动状态(即点击)时,是否有任何方法可以使用内联 css 更改按钮的背景颜色和/或边框颜色?
<button class="btn btn-xs btn-primary btn-inverse dropdown-toggle" type="button" data-toggle="dropdown" style="margin-top: 12px; background-color: rgba(0, 0, 0, 0); border-color:rgba(0, 0, 0, 0); margin-right:20px">
类似这样的东西,但在单击按钮时?
【问题讨论】:
-
不...不可能...您只能为默认状态提供内联 css...不同所需的任何更改都必须在样式表中或必须在样式标签内
-
如何在样式标签内完成?
-
使用 :active 选择器
-
这应该是stackoverflow.com/questions/28712267/…的可能重复项
标签: html css twitter-bootstrap-3