changing ToggleButton colors from react-bootstrap(更改Reaction-Bootstrap中的切换按钮颜色)
本文介绍了更改Reaction-Bootstrap中的切换按钮颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的应用程序上有一组ToggleButton,我想更改其背景颜色。目前,我的代码为所有按钮提供了<;。untoggled-Button>;的渐变,而未选中的按钮具有该渐变,并添加了一层蓝色薄膜。我有两个问题:我想要移除未切换按钮上的蓝色薄膜,以及我需要访问切换按钮来更改其样式。<;.toggled-Button>;只是一个目前不执行任何操作的占位符。
我想知道如何访问我的CSS中未选中的和选中的版本的ToggleButton,以覆盖默认的引导样式!
JSX:
<ToggleButtonGroup className="view" type="radio" name="options" defaultValue={2}>
<ToggleButton value={1} className="untoggled-button" > title</ToggleButton>
<ToggleButton value={2} className="untoggled-button"> title</ToggleButton>
<ToggleButton value={3} className="untoggled-button"> title</ToggleButton>
</ToggleButtonGroup>
css(这很不正确,但我希望能够同时设置未选中和选中按钮的样式):
.untoggled-button{
background-image: some gradient !important;
}
.toggled-button {
background-image: another gradient !important;
}
推荐答案
将背景颜色设置为透明并添加.active类似乎奏效了!
.untoggled-button{
background-image: some gradient !important;
background-color: transparent !important;
}
. untoggled-button.active {
background-image: another gradient !important;
}
这篇关于更改Reaction-Bootstrap中的切换按钮颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
沃梦达教程
本文标题为:更改Reaction-Bootstrap中的切换按钮颜色


猜你喜欢
- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06
- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01
- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07
- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01
- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01
- Flexslider 箭头未正确显示 2022-01-01
- Fetch API 如何获取响应体? 2022-01-01
- addEventListener 在 IE 11 中不起作用 2022-01-01
- 400或500级别的HTTP响应 2022-01-01
- 失败的 Canvas 360 jquery 插件 2022-01-01