Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change the thickness of an SVG shape

Tags:

html

svg

I'm not familiar enough with svg drawing.

I have this arrow in SVG format. How can I increase the thickness of the arrow?

<div style="width: 100px; height:100px;">    <svg viewBox="0 0 100 100">      <path d="M 50,0 L 60,10 L 20,50 L 60,90 L 50,100 L 0,50 Z" class="arrow" transform="translate(85,100) rotate(180)"></path>    </svg>  </div>

Thanks in advance

like image 265
Mojtaba Avatar asked Jun 07 '16 19:06

Mojtaba


People also ask

How do I change the stroke-width in SVG?

You can add a stroke with stroke="black" stroke-width="10" and then adjust your viewBox accordingly.

What is stroke-width in SVG?

The stroke-width attribute is a presentation attribute defining the width of the stroke to be applied to the shape. You can use this attribute with the following SVG elements: <altGlyph> <circle> <ellipse>


1 Answers

You can add a stroke with stroke="black" stroke-width="10" and then adjust your viewBox accordingly.

OLD:  <div style="width: 100px; height:100px;">    <svg viewBox="0 0 100 100">      <path d="M 50,0 L 60,10 L 20,50 L 60,90 L 50,100 L 0,50 Z" class="arrow" transform="translate(85,100) rotate(180)"></path>    </svg>  </div>  <br>  NEW:  <div style="width: 100px; height:100px;">    <svg viewBox="-10 -10 120 120">      <path d="M 50,0 L 60,10 L 20,50 L 60,90 L 50,100 L 0,50 Z" class="arrow" transform="translate(85,100) rotate(180)" stroke="black" stroke-width="10"></path>    </svg>  </div>
like image 168
Joseph Marikle Avatar answered Sep 21 '22 16:09

Joseph Marikle