css - 如何自定义标签的背景和颜色?

标签 css reactjs styles react-bootstrap

我是 reactreact-bootstrap 的新手,我想在 处于事件状态时自定义标签的背景标签文本的 颜色 当它们不活动时。我试图在外部 CSS 文件中覆盖背景样式 nav-style.active 但它不起作用。

如何从 react-bootstrap 自定义此属性和其他属性?

最佳答案

工作示例 https://codesandbox.io/s/pz5l469m0?codemirror=1&fontsize=14

添加一个简单的 CSS 就可以了

.nav-link.active {
    color: red !important;
    background-color: yellow !important;
}

关于css - 如何自定义标签的背景和颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54865818/

相关文章:

wpf - 如何隐藏 WPF 控件的一部分

javascript - 悬停功能有效时无法添加类

css - 如何通过 CSS 访问元素的类值

reactjs - Spring 静态内容(css)未正确提供(spring boot)

javascript - 类型错误 : undefined is not a function (evaluating dispatch)

javascript - 在 fullCalendar 4 和 React 中设置 eventRender

javascript - 为什么 javascript 不能在 if 语句中使用 .style.color

HTML <table> 不适合容器(总是更大)

css - 当我将它转换到我的 CMS 时,为什么 CSS 排序(使用复选框 hack)不起作用?

css - 未应用外部 CSS