rect in canvas by js

rect in canvas by js
<h1>how to draw a rect in canvas by js</h1>

<canvas id="my" width="200" height="100" style=" border:1px solid #f00;">

</canvas>



<script>
var c = document.getElementById("my");
var ctx = c.getContext("2d");
ctx.fillStyle = "#FF0000";
ctx.fillRect(2,5,150,75);


</script>



Note:- here 2 is distance on x axis, 5 is distance on y axis.
       here 150 is width of rect and 75 is height.
       fillstyle: in rectangel fillstyle property use to fil the background color of in rectangle.

demo is here https://jsfiddle.net/j9va5j34/


How we include font face in our HTML

How we include font face in our HTML

How we include font face in our HTML

Guys just open your genereted font face folder from www.fontsquirrel.com website. Follow these steps:-
  • Open your fonts folder whcih is generted from www.fontsquirrel.com website or any other website.
  • Copy all files from that folder fr example, .eot, .svg, .ttf, .woff. and paste into your HTML folder under fonts folder.
  • Now copy stylesheet file from generted folder and copy in your HTML fonts folder.
  • Now call styleshhet.css from your HTML fonts folder in your index.html file under HEAD part.
  • Now use font-family in your css file.
Follow this webistes for your need:-