Beispiel:SVG-viewbox-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">
  <style>
svg { 
  background: white;
  border: thin dotted steelBlue;
  width: 96%;
  height: 450px;
  padding: 0;
  }
path {
  stroke: black;
  stroke-width: 1;	
}
 
pattern path {
  stroke:#57c4ff;
  fill:none;
}
  </style>
  <title>Beispiel: Ubongo</title>
</head>
 
<body>
  <svg>
	<pattern id="grid" patternUnits="userSpaceOnUse" width="10" height="10" x="0" y="0">
	    <desc>Raster</desc>
		<path d="M0,0 v10 h10" />
    </pattern>
	<rect x="0" y="0" width="650" height="450" fill="url(#grid)"></rect>
	<path fill="#93b946" d="M20,20 h300 v100 h-100 v100 h-200 z" />
	<path fill="#c82f04" d="M320,20 h200 v200 h-200 z" />
	<path fill="gold" d="M220,120 h100 v100 h100 v100 h-100 v100 h-100 z" />
	<path fill="steelBlue" d="M420,220 h200 v100 h-100 v100 h-200 v-100 h100 z" />
  </svg>

</body>
</html>