Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
仅在prod模式下使用css和URL背景图像进行角度缩小_Css_Angular_Angular Cli V6 - Fatal编程技术网

仅在prod模式下使用css和URL背景图像进行角度缩小

仅在prod模式下使用css和URL背景图像进行角度缩小,css,angular,angular-cli-v6,Css,Angular,Angular Cli V6,使用带有CLI模板的Angular 6在css中具有渐变的图像背景。在开发模式下,它可以正常工作,但是当我执行prod版本(ng build“--prod”)时,css会转换为无效语法 以下是scss文件: .home-content { .mountain-header { margin: 0 auto; color: #fff; padding: 30px 10px; min-height: 110px; background: linear-gr

使用带有CLI模板的Angular 6在css中具有渐变的图像背景。在开发模式下,它可以正常工作,但是当我执行prod版本(ng build“--prod”)时,css会转换为无效语法

以下是scss文件:

.home-content {
  .mountain-header {
    margin: 0 auto;
    color: #fff;
    padding: 30px 10px;
    min-height: 110px;
    background: linear-gradient(180deg, rgba(0, 174, 199, .8) 0%, rgba(35,97,146,.8) 100%), url("https://cdnsite/background2.jpg") no-repeat !important;
    background-size: cover !important;
    background-position: center !important;
}
但是,当其缩小时,背景属性将转换为:

background: linear-gradient(180deg,rgba(0,174,199,.8) 0,rgba(35,97,146,.8) 100%) center!important/cover!important,url(https://cdnsite/background2.jpg) center!important/cover!important no-repeat!important!important!important

当我取出url时,它似乎在prod模式下工作(我得到背景大小和背景位置)。当我在后台属性中有Url时,它就像是在合并3个属性。

出于某种原因,如果我删除!在后台属性中很重要,它似乎解决了问题