【问题标题】:Background color not visible in Safari背景颜色在 Safari 中不可见
【发布时间】:2021-02-09 06:48:59
【问题描述】:

.chevron {
      position: relative;
      text-align: center;
      padding: 12px;
      margin-bottom: 6px;
    }
.chevron:before {
      content: '';
      position: absolute;
      top: 40px;
      left: 0;
      height: 100%;
      width: 60%;
        background-color: rgb(9, 73, 131);
      background-color: rgba(9, 73, 131, 1);
      transform: skew(0deg, 6deg);
        -webkit-transform: skew(0deg, 6deg);
        -moz-transform: skew(0deg, 6deg);
        -ms-transform: skew(0deg, 6deg);
        -o-transform: skew(0deg, 6deg);
    }
.chevron:after {
      content: '';
      position: absolute;
      top: 40px;
      right: 0;
      height: 100%;
      width: 60%;
        background-color: rgb(9, 73, 131);
      background-color: rgba(9, 73, 131, 1);
      transform: skew(0deg, -6deg);
        -webkit-transform: skew(0deg, -6deg);
        -moz-transform: skew(0deg, -6deg);
        -ms-transform: skew(0deg, -6deg);
        -o-transform: skew(0deg, -6deg);
    }

我有一个 Wordpress 项目,我在其中添加了背景颜色。背景颜色适用于除 Safari 之外的所有浏览器。我尝试了多种方法,例如给 rgb(For Old Browsers) rgba(For Latest Browsers),但它仍然不可见。

【问题讨论】:

  • 请在此处粘贴您的 css 代码
  • @LokeshThakur 添加了 CSS 代码。
  • 以及相关的 HTML!

标签: html css


【解决方案1】:

试试下面的 safari 浏览器 CSS。

_::-webkit-full-page-media, _:future, :root .chevron:before{
    background-color: rgb(9, 73, 131);
}
_::-webkit-full-page-media, _:future, :root .chevron:after{
    background-color: rgb(9, 73, 131);
}

【讨论】:

  • 项目中有一个特定部分需要背景色,而不是整个页面。
猜你喜欢
  • 2012-12-19
  • 1970-01-01
  • 2011-04-24
  • 2021-10-30
  • 2010-12-30
  • 1970-01-01
  • 2020-02-07
  • 1970-01-01
  • 2017-01-02
相关资源
最近更新 更多