HTML5 tag

The <radialGradient> HTML5 tag is used to draw SVG Gradients. Yes, modern browsers support it.

The following is the HTML5 version of an SVG example that would draw an ellipse using the <ellipse> tag and would use the <radialGradient> tag to define an SVG radial gradient. Similar way you can use the <linearGradient> tag to create SVG linear gradient.

<!DOCTYPE html>
            position: relative;
            left: 50%;
            -webkit-transform: translateX(-40%);
            -ms-transform: translateX(-40%);
            transform: translateX(-40%);
      <meta charset="utf-8" />
      <h2 align="center">HTML5 SVG Gradient Ellipse</h2>
      <svg id="svgelem" height="200" xmlns="">
         <radialGradient id="gradient" cx="50%" cy="50%" r="50%" fx="50%" fy="50%">
            <stop offset="0%" style="stop-color:rgb(200,200,200); stop-opacity:0"/>
            <stop offset="100%" style="stop-color:rgb(0,0,255); stop-opacity:1"/>
      <ellipse cx="100" cy="50" rx="100" ry="50" style="fill:url(#gradient)" />

Updated on: 29-Jan-2020


Kickstart Your Career

Get certified by completing the course

Get Started