html - 自定义背景颜色 flex 盒

标签 html css flexbox sapui5

我想在 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;
}

如您所见,自定义背景颜色根本不会应用: enter image description here

看看代码检查器,自定义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/

相关文章:

html - flex-basis 和 box-sizing

html - Vim:按需更改语法突出显示

javascript - 滚动时 jQuery 不透明度被切断

css - IFrame 在 IE 中重叠 Div(在 Chrome 中工作正常)

html - UIWebView 正确显示远程页面,但在 objective-c 中不显示本地页面

javascript - CSS Spritesheet 运动过渡。无需滑动背景图像即可轻松

jquery - 柔性过渡。平滑地填充空间

html - 如何使网站标题响应?

html - float div中的内容溢出问题

html - CSS 中的 SGML "content"