引导HTML页面内容的性别选择为新娘和新郎。页面加载时的btn-group
如下
然后,单击鼠标(在新娘按钮上),并btn-group
如下所示释放鼠标。背景色已更改,我尝试使用将其更改为红色css
。但不起作用。单击后,是否有可能使用来更改Bootstrap默认标签的背景颜色css
?
的CSS
.gender-label:active { background-color: red;}
的HTML
<li>
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-default gender-label">
<input type="radio" name="options" id="option1" autocomplete="off">
<span>Bride</span>
</label>
<label class="btn btn-default gender-label">
<input type="radio" name="options" id="option2" autocomplete="off">
<span>Groom</span>
</label>
</div>
</li>
在这种情况下,您可以创建自己的类及其必要的行为,而不是覆盖默认的Bootstrap样式:
<label class="btn btn-custom gender-label">
.btn-custom:hover,
.btn-custom.active,
.btn-custom.active:hover {
background-color: red;
}
JSFiddle-example您可以检查一下!
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句