<radialGradient>
<radialGradient> 요소는 원형 그라디언트를 설정합니다.
<radialGradient>
<radialGradient> 요소는 원형 그라디언트를 설정합니다.
정의(Definition)
- <radialGradient> 요소는 원형 그라디언트를 설정합니다.
1. 그라디언트
SVG를 이용한 그라디언트입니다.
Sample1
HTML
<div class="svgBox">
<svg class="svg">
<radialGradient id="radialGradient1" gradientUnits="userSpaceOnUse">
<stop offset="0" style="stop-color: #f6d365" />
<stop offset="1" style="stop-color: #fda085" />
</radialGradient>
<polygon fill="url(#radialGradient1)" points="130,128 65,148 15,102 30,36 95,16 145,62"></polygon>
</svg>
<svg class="svg">
<radialGradient id="radialGradient2" gradientUnits="userSpaceOnUse">
<stop offset="0" style="stop-color: #f6d365" />
<stop offset="1" style="stop-color: #fda085" />
</radialGradient>
<polygon fill="url(#radialGradient2)" points="120,142 9,93 107,22"></polygon>
</svg>
</div>
CSS
.svgBox .svg {width: 160px; height: 160px; background: #ffebee;}
TOTAL
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>SVG</title>
<style>
.svgBox .svg {width: 160px; height: 160px; background: #ffebee;}
</style>
</head>
<body>
<div class="svgBox">
<svg class="svg">
<radialGradient id="radialGradient1" gradientUnits="userSpaceOnUse">
<stop offset="0" style="stop-color: #f6d365" />
<stop offset="1" style="stop-color: #fda085" />
</radialGradient>
<polygon fill="url(#radialGradient1)" points="130,128 65,148 15,102 30,36 95,16 145,62"></polygon>
</svg>
<svg class="svg">
<radialGradient id="radialGradient2" gradientUnits="userSpaceOnUse">
<stop offset="0" style="stop-color: #f6d365" />
<stop offset="1" style="stop-color: #fda085" />
</radialGradient>
<polygon fill="url(#radialGradient2)" points="120,142 9,93 107,22"></polygon>
</svg>
</div>
</body>
</html>
호환성(Compatibility) 더보기 caniuse.com
6 | 7 | 8 | 9 | 10 | 11 | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<radialGradient> | 사용가능 | 사용가능 | 사용가능 | 사용가능 | 사용가능 | 사용안됨 | 사용안됨 | 사용안됨 | 사용가능 | 사용가능 | 사용가능 | 사용가능 | 사용가능 | 사용가능 |