Description of the stroke properties

SVG offers different stroke properties that can be applied to any kind of text, lines and outlines of elements. They allow controlling various aspects of a stroke. Here are some stroke properties:

  • stroke for specifying the color of a line, outline or text of an element,
  • stroke-linecap for specifying how the endings of an SVG line are rendered,
  • stroke-width for specifying the thickness of a line, outline, or text of an element,
  • stroke-dasharray for specifying dashed lines.

Example of the stroke property:



  
    Title of the document
  
  
    
      
        
        
        
      
      Sorry, your browser doesn't support inline SVG.
    
  

Example of the stroke-linecap property:



  
    Title of the document
  
  
    
      
        
        
        
      
    
  

Example of the stroke-width property:



  
    Title of the document
  
  
    
      
        
        
        
      
    
  

Example of the stroke-dasharray property:



  
    Title of the document
  
  
    
      
        
        
        
      
    
  

Practice Your Knowledge

Which of the following statements is/are true about SVG stroking in HTML?

Quiz Time: Test Your Skills!

Ready to challenge what you've learned? Dive into our interactive quizzes for a deeper understanding and a fun way to reinforce your knowledge.

Do you find this helpful?