SVG Kontur Özellikleri


SVG Kontur Özellikleri

SVG, çok çeşitli vuruş özellikleri sunar. Bu bölümde aşağıdakilere bakacağız:

  • inme
  • Darbe genişliği
  • kontur çizgisi
  • inme-dasharray

Tüm kontur özellikleri, daire gibi her türlü çizgiye, metne ve elemanların ana hatlarına uygulanabilir.


SVG konturu Özellik

kontur özelliği, bir öğenin satırının, metninin veya anahattının rengini tanımlar:

Sorry, your browser does not support inline SVG.

İşte SVG kodu:

Örnek

<svg height="80" width="300">
  <g fill="none">
    <path stroke="red" d="M5 20 l215 0" />
    <path stroke="black" d="M5 40 l215 0" />
    <path stroke="blue" d="M5 60 l215 0" />
  </g>
</svg>

SVG kontur genişliği Özellik

Strok-width özelliği, bir öğenin çizgi, metin veya anahattının kalınlığını tanımlar:

Sorry, your browser does not support inline SVG.

İşte SVG kodu:

Örnek

<svg height="80" width="300">
  <g fill="none" stroke="black">
    <path stroke-width="2" d="M5 20 l215 0" />
    <path stroke-width="4" d="M5 40 l215 0" />
    <path stroke-width="6" d="M5 60 l215 0" />
  </g>
</svg>


SVG kontur-linecap Özellik

Strok-linecap özelliği, açık bir yola farklı türde sonlar tanımlar:

Sorry, your browser does not support inline SVG.

İşte SVG kodu:

Örnek

<svg height="80" width="300">
  <g fill="none" stroke="black" stroke-width="6">
    <path stroke-linecap="butt" d="M5 20 l215 0" />
    <path stroke-linecap="round" d="M5 40 l215 0" />
    <path stroke-linecap="square" d="M5 60 l215 0" />
  </g>
</svg>

SVG vuruş-dasharray Özellik

Strok-dasharray özelliği kesikli çizgiler oluşturmak için kullanılır:

Sorry, your browser does not support inline SVG.

İşte SVG kodu:

Örnek

<svg height="80" width="300">
  <g fill="none" stroke="black" stroke-width="4">
    <path stroke-dasharray="5,5" d="M5 20 l215 0" />
    <path stroke-dasharray="10,10" d="M5 40 l215 0" />
    <path stroke-dasharray="20,10,5,5,5,10" d="M5 60 l215 0" />
  </g>
</svg>