Beispiel:SVG-marker-2.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 {
  stroke: #666;
  fill:none;
  stroke-width:20;
}
 
marker {
  stroke: #000;
  fill:url(#verlauf1);
} 
 
#eins {
  stroke-width: .05;
}
 
#zwei {
 stroke-width: 1; 
} 
  </style>
  <title>Beispiel: markerUnits</title>
</head>
 
<body>
  <h1>Beispiel: markerUnits</h1>
 
  <main>
  <svg viewbox="0 0 900 550">
    <defs>
      <marker id="eins" markerWidth="22" markerHeight="22" markerUnits="strokeWidth" refx="1" refy="1">
        <circle cx="1" cy="1" r=".5" />
      </marker>
 
      <marker id="zwei" markerWidth="22" markerHeight="22" markerUnits="userSpaceOnUse" refx="10" refy="10">
        <circle cx="10" cy="10" r="9" />
      </marker>
      <radialGradient id="verlauf1" >
        <stop offset="3%" stop-color="#c32e04" />
        <stop offset="90%" stop-color="#dfac20" />
       </radialGradient>
    </defs>
 
    <path d="M20,100 h100" style="marker: url(#eins);" />
 
    <path d="M20,400 h100 a20,20 0 0,0 20,-20 v-50 c0,-140 300,-140 300,10  a50,50 0 0,0 100,0 v-200" style="marker: url(#zwei);" />
  </svg>
  </main>
</body>
</html>