将linearGradient转换为CSS背景

将linearGradient转换为CSS背景,css,svg,linear-gradients,Css,Svg,Linear Gradients,我有一个SVG,包含以下内容: <linearGradient id="path-2_2_" gradientUnits="userSpaceOnUse" x1="-275.652" y1="410.9046" x2="-275.0113" y2="412.0578" gradientTransform="matrix(46 0 0 -45.9998 12690 18947.9102)"> <stop offset="0" style="stop-color: rgb(

我有一个SVG,包含以下内容:

<linearGradient id="path-2_2_" gradientUnits="userSpaceOnUse" x1="-275.652" y1="410.9046" x2="-275.0113" y2="412.0578" gradientTransform="matrix(46 0 0 -45.9998 12690 18947.9102)">
    <stop offset="0" style="stop-color: rgb(248, 64, 24);"></stop>
    <stop offset="0.6458" style="stop-color: rgb(248, 64, 24); stop-opacity: 0.6009;"></stop>
    <stop offset="1" style="stop-color: rgb(248, 64, 24); stop-opacity: 0.2527;"></stop>
</linearGradient>

<> >代码>渐变变换正在做某事,但我不确定什么,以及如何用CSS样式复制它。

以获得你需要首先考虑的最后的渐变:<代码> X1/Y1/X2/Y2 < /代码>,这是定义方向(直到现在很容易)然后你需要能够理解在使用后对梯度所做的变换,这并不是一件小事。因此,要么你是SVG和数学家大师,你可以通过计算来找到你需要在CSS中使用的值,要么你可以使用一个工具来转换你的梯度(比如),或者你查看梯度并尝试近似它

就我个人而言,我可以做近似:

.box{
背景:
线性梯度(30度,rgb(248,64,24)30%,rgba(248,64,24,0.60)42%,rgba(248,64,24,0.25)50%);
宽度:400px;
高度:150像素;
}

试试这个:

body{
  background-image: url(/*link to your svg file*/)
}

我希望我能帮忙;)

如果不添加SVG标记,则不会调用SVG向导:)您没有回答问题或提供有意义的替代方案。
body{
  background-image: url(/*link to your svg file*/)
}