Beispiel:SVG-viewbox-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" media="screen" href="./Beispiel:SELFHTML-Beispiel-Grundlayout.css">
  <style>
svg { 
  border: thin dotted #337799;
  width: 96%;
  height: auto;
}
path {
  stroke: black;
  stroke-width: 1;	
}
 
pattern path {
  stroke: #57c4ff;
  fill: none;
}
  </style>
  <title>Beispiel: Ubongo responsiv</title>
</head>
 
<body>
  <h1>Beispiel: Ubongo responsiv</h1>
 
  <svg viewBox="0 0 650 450">
      <defs>
	<pattern id="grid" patternUnits="userSpaceOnUse" width="10" height="10" x="0" y="0">
	   <desc>Raster</desc>
	   <path d="M0,0 v10 h10" />
       </pattern>
      </defs>
 
      <rect x="0" y="0" width="650" height="450" fill="url(#grid)"></rect>
      <path fill="#5a9900" d="M20,20 h300 v100 h-100 v100 h-200 z" />
      <path fill="#c32e04" d="M320,20 h200 v200 h-200 z" />
      <path fill="#dfac20" d="M220,120 h100 v100 h100 v100 h-100 v100 h-100 z" />
      <path fill="#3983ab" d="M420,220 h200 v100 h-100 v100 h-200 v-100 h100 z" />
    </svg>
  
</body>
</html>