JavaScript中背景图片的线性渐变

时间:2019-03-28 07:45:31

标签: javascript css background-image

此代码出现错误:

var sectionStyle = {
  paddingTop:"2%",
  width: "100%",
  height: "100%",
  backgroundImage: "url(" + Background + ") , linearGradient(#eb01a5, #d13531)"
}

错误是:

  

解析错误编译失败。 ./src/App.js第203行:解析错误:意外的令牌201 |宽度:“ 100%”,202 |高度:“ 100%”,> 203 | backgroundImage:“ url(” +背景+“)”,linearGradient(#eb01a5,#d13531'); | ^ 204 | } 205 | 206 |

1 个答案:

答案 0 :(得分:0)

代替:键入=

尝试

var sectionStyle = {
  paddingTop = "2%",
  width = "100%",
  height = "100%",
  backgroundImage = "url(" + Background + ") , linearGradient(#eb01a5, #d13531)"
}