【问题标题】:changing white backgroud in clip-path更改剪辑路径中的白色背景
【发布时间】:2019-05-21 22:46:14
【问题描述】:

是否可以在应用剪辑路径后更改保留在 chrome 中的白色背景的颜色?

我已经尝试了背景剪辑方法和一些 css 调整,因为我看到了其他疑问

.header {
height: 100vh;
background-image: 
linear-gradient(to right bottom, 
rgba(204, 227, 233, 0.8),
rgba(6, 6, 7, 0.3)),   

background-repeat: round;
background-position: inherit;
position: relative;
background-clip: black;
clip-path: polygon(0 0, 100% 0, 100% 60vh, 0 100%);
}

没用

【问题讨论】:

    标签: css clip-path


    【解决方案1】:

    您可以设置父元素的背景颜色。例如:

    .header-container {
      background-color: black;
    }
    
    .header {
      height: 100vh;
      background-image: linear-gradient(
        to right bottom,
        rgba(204, 227, 233, 0.8),
        rgba(6, 6, 7, 0.3)
      );
      clip-path: polygon(0 0, 100% 0, 100% 60vh, 0 100%);
    }
    <div class="header-container">
      <div class="header"></div>
    </div>

    【讨论】:

      猜你喜欢
      • 2016-08-03
      • 2016-03-31
      • 2023-02-14
      • 1970-01-01
      • 2014-01-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-11
      相关资源
      最近更新 更多