VOOZH about

URL: https://www.geeksforgeeks.org/html/svg-stroke-properties/

⇱ SVG Stroke Properties - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

SVG Stroke Properties

Last Updated : 7 Aug, 2020

The SVG offers several stroke properties to be applied to the SVG element. There are lots of properties under stroke properties which can be applied any kind of lines, text, and outlines of elements like a circle.

Syntax:

<elementName stroke="stroke color"
 stroke-width="Width of the stroke"
 stroke-linecap="Ending style to a stroke"
 stroke-dasharray="make a dashed stroke">

Property value: 

  • stroke: set the stroke to an element.
  • stroke-width: set the stroke width of an element.
  • stroke-linecap: sets the ending stroke style.
  • stroke-dasharrray: set the style os a stroke such as dashed stroke.

Few examples are given below: 

Example 1: Stroke and stroke-dasharray property:

Output:

👁 Image

Example 2: stroke-width and stroke-linecap property: 

Output:

👁 Image

Supported Browsers : 

  • Chrome
  • Edge
  • Opera
  • Internet Explorer
  • Safari
  • Firefox
Comment
Article Tags: