1、高斯模糊:不用背,美工做
<body> <svg width="500px" height="300px" style="border: 1px solid"> <defs><!-- 要先定义 --> <linearGradient id="bg1" x1="0" y1="0" x2="0" y2="100%"><!-- 横向渐变 --><!-- x2=100%:斜着渐变 --> <stop offset="0%" style="stop-color: rgb(255,255,0);"></stop> <stop offset="100%" style="stop-color: rgb(255,0,0);"></stop> </linearGradient> <filter id="Gaussian"> <feGaussianBlur in="SourceGraphic" stdDeviation="20"></feGaussianBlur><!--stdDeviation:数字越大越模糊 --> </filter> </defs> <rect x="100" y="100" height="100" width="200" style="fill:url(#bg1); filter:url(#Gaussian)"></rect> </svg></body>