How to draw SVG Logo in HTML5?

HTMLWeb DevelopmentFront End Technology

SVG stands for Scalable Vector Graphics and is a language for describing 2D-graphics and graphical applications in XML and the XML is then rendered by an SVG viewer. Most of the web browsers can display SVG just like they can display PNG, GIF, and JPG.

You can draw shapes like circle, rectangle, line, etc using SVG in HTML5 easily. Let’s see an example to draw SVG logo. For that, we will be creating a linear gradient:


You can try to run the following code to draw SVG logo −

<!DOCTYPE html>
      <title>HTML5 SVG logo</title>
      <svg height="170" width="400">
            <linearGradient id="lgrad" x1="0%" y1="0%" x2="100%" y2="0%">
               <stop offset="0%"
               style="stop-color:rgb(184,78,43);stop-opacity:1" />
               <stop offset="50%"
               style="stop-color:rgb(241,241,241);stop-opacity:1" />
               <stop offset="100%"
               style="stop-color:rgb(255,141,52);stop-opacity:1" />
         <ellipse cx="100" cy="70" rx="85" ry="55" fill="url(#lgrad)" />
         <text fill="#rgb(141,218,255)" font-size="40" font-family="Verdana"
            x="50" y="86">logo</text>


Updated on 16-Dec-2021 09:08:49