我想在 Flexbox 上设置背景颜色并尝试如下。
应用程序上的类定义:
<App id="app" class="weight-protocol"></App>
在 FlexBox 上:
<FlexBox
height="20%"
width="100%"
alignItems="Start"
class="calendar-header-bg"
justifyContent="Center">
在CSS文件中:
.weight-protocol .calendar-header-bg {
background-color: #007DB2;
}
看看代码检查器,自定义CSS类停留在开头calendar-header-bg
而不是最后。
最佳答案
您是否尝试过不使用 .weight-protocol
?
.calendar-header-bg {
background-color: #007DB2;
}
如果不起作用,您可以使用!important
标签:
.calendar-header-bg {
background-color: #007DB2 !important;
}
您也可以尝试仅使用background
标签而不是background-color
:
.calendar-header-bg {
background: #007DB2 !important;
}
我希望这会有所帮助...
祝你好运!
关于html - 自定义背景颜色 flex 盒,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41160080/