Beispiel:SVG-marker-3.html

Aus SELFHTML-Wiki
Wechseln zu: Navigation, Suche
<!DOCTYPE html>
<html lang="de">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0;" />
  <link rel="stylesheet" media="screen" href="./Beispiel:SELFHTML-Beispiel-Grundlayout.css" />
  <style> 
svg {
  height: 550px;
  }  
path {
  fill: none;
  stroke: #3983ab;
  stroke-width: 2;
  }
text {
  font-size:12px;
  }
marker, marker path {
  fill: #dfac20;
  stroke: #000;
  stroke-width:1;
} 
  </style>
  <title>Beispiel: Das Marker-Element</title>
</head>
 
<body>
  <h1>Beispiel: marker orient="auto"</h1>
 
  <main>
  <svg viewbox="0 0 900 550">
    <defs>
      <marker id="markerAnfang" markerWidth="7" markerHeight="7" refx="4" refy="4">
        <rect x="1" y="1" width="5" height="5" />
      </marker>
 
      <marker id="markerPfeil" markerWidth="130" markerHeight="13" refx="2" refy="6">
        <path d="M2,2 v8 l8,-4z "/>
      </marker>
 
	  <marker id="markerPfeilAuto" markerWidth="130" markerHeight="13" refx="2" refy="6" orient="auto">
        <path d="M2,2 v8 l8,-4z "/>
      </marker>
    </defs>
 
    <path d="M20,10 v100 h100 m50,0 c100,-140 150,140 250,0 c100,-140 150,140 250,0"
          style="marker: url(#markerPfeil); marker-start: url(#markerAnfang);"
           />
 
    <path d="M20,150 v100 h100 m50,0 c100,-140 150,140 250,0 c100,-140 150,140 250,0"
          style="marker: url(#markerPfeilAuto); marker-start: url(#markerAnfang);"
    />
 
  </svg>
  </main>
</body>
</html>