Beispiel:SVG-marker-1.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" type="text/css" 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: Das Marker-Element</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="markerKreis" markerWidth="8" markerHeight="8" refx="4" refy="4">
        <circle cx="4" cy="4" r="3" />
      </marker>
 
      <marker id="markerPfeil" markerWidth="130" markerHeight="13" refx="2" refy="6">
        <path d="M2,2 v8 l8,-4z "/>
		<text x="15" y="10" stroke="none" fill="#c32e04">Ziel</text>
      </marker>
    </defs>
 
    <path d="M20,10 v100 h100"
          style="marker-start: url(#markerAnfang);
                 marker-mid: url(#markerKreis);
	         marker-end: url(#markerPfeil);
                "
           />
 
    <path d="M20,150 v100 h100 m50,0 c100,-140 150,140 250,0 c100,-140 150,140 250,0"
          style="marker-start: url(#markerAnfang);
                 marker-mid: url(#markerKreis);
	         marker-end: url(#markerPfeil);
                "
    />
 
  </svg>
  </main>
</body>
</html>