Reproducing SVG gradient equivalent to CSS gradient with linear-gradient

后端 未结 2 1035
清酒与你
清酒与你 2020-12-12 00:40

You can create CSS gradients in modern sites with something as simple as:

background-image: linear-gradient(red, orange);

The goal is to r

2条回答
  •  囚心锁ツ
    2020-12-12 00:57

    Per your post, to reproduce the gradient in SVG, define your linear gradient in the svg element.

    See the snippet below (the css only applies to the html divs).

    div {
      height: 100px;
      width: 100px;
      display: inline-block;
      background-color: red;
      background-image: linear-gradient(red, orange);
    }

提交回复
热议问题