The HTML canvas lineWidth property is used to set or return the width of the line (thickness of the line). The width of the line is set in terms of pixels. The default value of this property is 1.
context.lineWidth = number;
- number: This property value indicates the number which specifies the line width in terms of pixels. This property ignores the zero, negative, infinity, and NaN values.
Supported Browsers: The browser supported by HTML canvas lineWidth property are listed below:
- Google Chrome
- Internet Explorer 9.0
- HTML | canvas shadowBlur Property
- HTML | canvas strokeStyle Property
- HTML | canvas fillStyle Property
- HTML | canvas shadowOffsetX Property
- HTML | canvas textBaseline Property
- HTML | canvas lineJoin Property
- HTML | canvas shadowColor Property
- HTML | canvas lineCap Property
- HTML | canvas textAlign Property
- HTML | canvas shadowOffsetY Property
- HTML | canvas font Property
- Web HTMLCanvasElement API | Canvas Element width property
- HTML | canvas Tag
- HTML | DOM Canvas Object
- HTML | Canvas Basics
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.