---
title: "Code for Designing  Any Types of Logos in HTML5"  
description: "In HTML5 the canvas & SVG is a powerful tool by which you can create different type of images, logos, animated images, games etc. By the help of JavaS"  
author: "Arti Mishra"  
published: 2018-05-11  
updated: 2019-09-07  
canonical: https://www.mindstick.com/articles/12906/code-for-designing-any-types-of-logos-in-html5  
category: "html"  
tags: ["html5", "html5 canvas"]  
reading_time: 3 minutes  

---

# Code for Designing  Any Types of Logos in HTML5

HTML5 is the [latest version](https://www.mindstick.com/forum/156585/latest-version-of-bootstrap) of HTML. It is more **powerful & light weight** [web application](https://www.mindstick.com/interview/1126/does-silverlight-web-application-work-with-all-browsers) [language](https://answers.mindstick.com/qa/43850/how-to-create-digital-clock-in-c-language) that is used for design [responsive](https://www.mindstick.com/forum/12845/how-to-responsive-div-table-struggle-multiple-rows) WebPages.

HTML5 is developed by co-[operation](https://answers.mindstick.com/qa/97910/what-is-the-aim-of-operation-namaste) of two organisation **W3C ([World Wide Web](https://answers.mindstick.com/qa/112778/who-invented-the-world-wide-web) Consortium)** and **WHATWG (Web Hypertext Application [Technology](https://www.mindstick.com/articles/12616/how-technology-is-influencing-online-business) Working Group)** and started to develop from 2000 and after that it is commercially launch by Google in 2012.

HTML5 is combination of different [languages](https://yourviews.mindstick.com/story/2085/let-s-check-out-the-ancient-indian-languages) like -

**HTML4 + JS + XML + XHTML1.0 + CSS = HTML5.**

## \

In HTML5 the **canvas & SVG** is a powerful tool by which you can create different type of images, logos, animated images, games etc. By the help of **[JavaScript](https://www.mindstick.com/forum/12869/how-to-c-sharp-and-javascript-email-validation-regex) & HTML5 code,** you can create our own images without using any third party tools like Photoshop, coral-draw etc.

## \

## Code for Designing HTML5 logos -

## Example : 1

```
<!DOCTYPE html>
<html>
<head><title> Canvas Example </title>
<meta charset="UTF-8">
<script>
function loader()
{
 var c=document.getElementById("myCanvas");
 var ctx=c.getContext("2d");
var rgrd=ctx.createRadialGradient(190,110,5,220,150,180);    rgrd.addColorStop(0.3,"black");
   rgrd.addColorStop(1.0,"#999999");
  ctx.beginPath();
  ctx.lineWidth='15';
  ctx.strokeStyle='black';
  ctx.moveTo(215,120);
  ctx.lineTo(215,180);
  ctx.stroke();
  ctx.beginPath();
  ctx.fillStyle=rgrd;
  ctx.strokeStyle='#999999';
  ctx.lineWidth='2';
  ctx.moveTo(70,230);
  ctx.lineTo(150,140);
  ctx.lineTo(230,230);
  ctx.lineTo(210,230);
  ctx.lineTo(150,170);
  ctx.lineTo(90,230);
  ctx.lineTo(70,230);
  ctx.fill();
  ctx.stroke();

  ctx.beginPath();
  ctx.lineWidth='2';
  ctx.fillStyle='maroon';
  ctx.strokeStyle='maroon';
  ctx.translate(230,0);
  ctx.moveTo(70,230);
  ctx.lineTo(150,140);
  ctx.lineTo(230,230);
  ctx.lineTo(210,230);
  ctx.lineTo(150,170);
  ctx.lineTo(90,230);
  ctx.lineTo(70,230);
  ctx.fill();
  ctx.closePath();
  ctx.stroke();

  ctx.beginPath();
  ctx.lineWidth='2';
  ctx.fillStyle=rgrd;
  ctx.strokeStyle='white';
  ctx.translate(-160,-120);
  ctx.scale(1.3,1.5);
  ctx.moveTo(70,230);
  ctx.lineTo(150,140);
  ctx.lineTo(230,230);
  ctx.lineTo(210,230);
  ctx.lineTo(150,170);
  ctx.lineTo(90,230);
  ctx.lineTo(70,230);
  ctx.fill();
  ctx.stroke();
	 
 ctx.beginPath();   ctx.fillStyle='black';
  ctx.rect(58,208,7,7);
  ctx.rect(140,200,18,20);
  ctx.rect(235,208,8,8);
  ctx.fill();
  ctx.stroke();
	 
ctx.beginPath();  // ctx.scale(1.5,1);
  ctx.font="bolder 5em Copperplate Gothic";
  ctx.fillText("D",5,300);
  ctx.font="bolder 3.8em Copperplate Gothic";
  ctx.fillText("LUGOS",70,300);
     ctx.stroke();

  ctx.beginPath();
  ctx.fillStyle='maroon';
  ctx.font="bolder 2.2em Copperplate Gothic";
  ctx.fillText("C",25,330);
  ctx.font="bolder 1.8em Copperplate Gothic";
  ctx.fillText("ONSTRUCTION",53,330);
     ctx.stroke();
}

</script> </head>
<body onLoad="loader();"bgcolor="#999999">
<center>
<h1>Canvas Example</h1>
<table bordercolor="#000000">
<tr><td bgcolor="#000000">
<canvas id="myCanvas"height="500"width="500"style="background-color:#FFFFFF">
</canvas>
</td>
<td bgcolor="#000000">
<img src="logos/dlugos.png" height="500"width="500">
</td></tr></table>
</center>
</body>
</html>
```

## OUTPUT :

![Code for Designing  Any Types of Logos in HTML5](https://www.mindstick.com/mindstickarticle/1649234d-9db0-455e-b0ab-b95145f96b0b/images/42c038b5-1632-4041-94a8-e01a81f23217.png)

\

## Example : 2

```
<!DOCTYPE html> <html>
<head><title> Canvas Example </title>
<meta charset="UTF-8">
<script>

function loader() {
 var c=document.getElementById("myCanvas");
 var ctx=c.getContext("2d");
   ctx.beginPath();
   ctx.strokeStyle='#CC0000';
   ctx.lineCap='round';
   ctx.lineWidth=70;
   ctx.moveTo(40,40);
   ctx.lineTo(140,40);
   ctx.stroke();

   ctx.beginPath();
   ctx.strokeStyle='#000066';
   ctx.lineCap='round';
   ctx.lineJoin='round';

   ctx.lineWidth=60;
   ctx.moveTo(140,130);
   ctx.lineTo(40,130);
   ctx.lineTo(40,240);

   ctx.moveTo(220,30);
   ctx.lineTo(220,240);

   ctx.moveTo(300,30);
   ctx.lineTo(300,240);
   ctx.lineTo(400,240);
   ctx.lineTo(490,30);
   ctx.lineTo(560,240);
   ctx.lineTo(480,240);
   ctx.stroke();
} 
</script> </head>
<body onLoad="loader();"bgcolor="#3333CC">
<center>
<h1>Canvas Example</h1>
<table bordercolor="#000000">
<tr><td bgcolor="#000000">
<canvas id="myCanvas"height="300"width="600"style="background-color:#FFFFFF">
</canvas>
</td>
<td bgcolor="#000000">
<img src="LOGOS/img.png" height="300"width="600">
</td></tr></table>
</center>
</body>
</html>
```

## Output :

![Code for Designing  Any Types of Logos in HTML5](https://www.mindstick.com/mindstickarticle/1649234d-9db0-455e-b0ab-b95145f96b0b/images/cd957257-42ca-4bc4-ba11-daa6c0f15f8a.png)**\**

## \

## Example 3 :

```
<!DOCTYPE html> <html>
<head><title> Canvas Example </title>
<meta charset="UTF-8">
<script>

function loader() {
 var c=document.getElementById("myCanvas");
 var ctx=c.getContext("2d");
 ctx.beginPath();
 ctx.lineWidth=10;
 ctx.scale(0.8,1);
    ctx.arc(300,250,190,0,7);
 ctx.strokeStyle='#CCCCCC';
 ctx.fillStyle="black";
 ctx.fill();
 ctx.stroke();
 ctx.closePath();

 ctx.beginPath();
 ctx.arc(300,250,100,0,7);
 ctx.fillStyle="white";
 ctx.fill();
 ctx.stroke();
 ctx.closePath();

 ctx.beginPath();
 ctx.moveTo(300,150);
 ctx.lineTo(300,250);
 ctx.lineTo(200,250);
 ctx.arc(300,250,100,3,5);
 ctx.lineWidth=5;
 ctx.fillStyle="#3366FF";
 ctx.fill();
 ctx.stroke();
 ctx.closePath();

 ctx.beginPath();
 ctx.moveTo(300,350);
 ctx.lineTo(300,250);
 ctx.lineTo(400,250);
 ctx.arc(300,250,100,6.6,1.6);
 ctx.fillStyle="#3366FF";
 ctx.fill();
 ctx.stroke();
 ctx.closePath();

 ctx.beginPath();
 ctx.moveTo(300,152);
 ctx.lineTo(300,348);
 ctx.strokeStyle='black';
 ctx.moveTo(202,250);
    ctx.lineTo(398,250);
 ctx.stroke();
 ctx.closePath();

 ctx.fillStyle="white";
 ctx.font="small-caps bold 5em Microsoft Sans Serif";
 ctx.fillText("M",262,142);
 ctx.rotate(-0.5);
 ctx.fillText("B",72,260);
 ctx.rotate(1.2);
 ctx.fillText("W",360,-110);

ctx.stroke();  }

</script> </head>
<body onLoad="loader();"bgcolor="#3366FF">
<center>
<h1>Canvas Example</h1>
<table bordercolor="#000000">
<tr><td bgcolor="#000000">
<canvas id="myCanvas"height="500"width="600"style="background-color:#FFFFFF">
</canvas>
</td>
<td bgcolor="#000000">
<img src="LOGOS/BMW.jpg" height="500"width="600">
</td></tr></table>
</center>
</body>
</html>
```

## Output :

![Code for Designing  Any Types of Logos in HTML5](https://www.mindstick.com/mindstickarticle/1649234d-9db0-455e-b0ab-b95145f96b0b/images/69944064-c79e-4312-9a49-c48abc85389c.png)**\**

---

Original Source: https://www.mindstick.com/articles/12906/code-for-designing-any-types-of-logos-in-html5

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
