Beispiel:SVG-47-stroke-dasharray.html
Aus SELFHTML-Wiki
<!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>
line, circle {
stroke: #337599;
stroke-width: 5;
}
.eins {
stroke-dasharray: 1%, 1%;
}
.zwei {
stroke-dasharray: 1%, 5%;
}
.drei {
stroke-dasharray: 100 10 10 10;
}
.vier {
stroke-dasharray: 90, 20, 0, 20, 0, 20;
stroke-linecap: round;
stroke-width: 8;
stroke-dashoffset: -4;
}
circle {
stroke-width: 50;
animation: rotation 19s infinite linear;
fill: none;
}
@keyframes rotation {
0 {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
</style>
<title>Beispiel: stroke-dasharray</title>
</head>
<body>
<h1>Strichmuster mit <code>stroke-dasharray</code></h1>
<svg viewBox="0 0 700 270">
<line class="eins" x1="10" y1="5" x2="590" y2="5" />
<line class="zwei" x1="10" y1="40" x2="590" y2="40" />
<line class="drei" x1="10" y1="75" x2="590" y2="75" />
<line class="vier" x1="10" y1="109" x2="590" y2="109" />
<text x="10" y="23">1%, 1%</text>
<text x="10" y="58">1%, 5%</text>
<text x="10" y="92">100 10 10 10</text>
<text x="10" y="128">90, 20, 0, 20, 0, 20; stroke-linecap: round</text>
<g transform="translate(550,200)">
<circle class="eins" r="40" />
</g>
</svg>
</body>
</html>