<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Development</title>
    <link>https://feed.newshole.app/</link>
    <item>
      <title>SVG</title>
      <guid isPermaLink="false">svg</guid>
      <pubDate>Mon, 09 Nov 2026 18:00:00 +0000</pubDate>
      <content:encoded><![CDATA[
<h2>Width and height</h2>
<p>A drawing written into the article, with a width and a height.</p>
<svg xmlns="http://www.w3.org/2000/svg" width="320" height="160" viewBox="0 0 320 160">
  <rect width="320" height="160" fill="#f2efe6"/>
  <circle cx="80" cy="80" r="50" fill="#d9534f"/>
  <rect x="150" y="30" width="100" height="100" fill="#3a7bd5"/>
  <polygon points="255,130 285,30 315,130" fill="#5cb85c"/>
</svg>

<h2>Proportions only</h2>
<p>A drawing with a shape but no width or height, which a browser stretches across the column.</p>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 600 120">
  <defs>
    <marker id="proportions-arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="8" markerHeight="8" orient="auto">
      <path d="M0,0 L10,5 L0,10 z" fill="#555"/>
    </marker>
  </defs>
  <rect x="10" y="20" width="140" height="80" rx="8" fill="#e8f0fa" stroke="#3a7bd5" stroke-width="3"/>
  <rect x="230" y="20" width="140" height="80" rx="8" fill="#eaf6ea" stroke="#5cb85c" stroke-width="3"/>
  <rect x="450" y="20" width="140" height="80" rx="8" fill="#fdf3e4" stroke="#f0ad4e" stroke-width="3"/>
  <line x1="150" y1="60" x2="226" y2="60" stroke="#555" stroke-width="3" marker-end="url(#proportions-arrow)"/>
  <line x1="370" y1="60" x2="446" y2="60" stroke="#555" stroke-width="3" marker-end="url(#proportions-arrow)"/>
</svg>

<h2>Wider than the column</h2>
<p>A drawing whose width is far wider than any column.</p>
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="120" viewBox="0 0 1200 120">
  <rect x="0" width="100" height="120" fill="#3a7bd5"/>
  <rect x="100" width="100" height="120" fill="#5cb85c"/>
  <rect x="200" width="100" height="120" fill="#f0ad4e"/>
  <rect x="300" width="100" height="120" fill="#d9534f"/>
  <rect x="400" width="100" height="120" fill="#3a7bd5"/>
  <rect x="500" width="100" height="120" fill="#5cb85c"/>
  <rect x="600" width="100" height="120" fill="#f0ad4e"/>
  <rect x="700" width="100" height="120" fill="#d9534f"/>
  <rect x="800" width="100" height="120" fill="#3a7bd5"/>
  <rect x="900" width="100" height="120" fill="#5cb85c"/>
  <rect x="1000" width="100" height="120" fill="#f0ad4e"/>
  <rect x="1100" width="100" height="120" fill="#d9534f"/>
</svg>

<h2>Text</h2>
<p>A chart with labels and numbers drawn as text.</p>
<svg xmlns="http://www.w3.org/2000/svg" width="360" height="220" viewBox="0 0 360 220" font-family="sans-serif" font-size="12">
  <rect width="360" height="220" fill="#ffffff"/>
  <text x="180" y="20" text-anchor="middle" font-size="14" font-weight="bold" fill="#222">Visits</text>
  <line x1="40" y1="190" x2="340" y2="190" stroke="#222"/>
  <line x1="40" y1="30" x2="40" y2="190" stroke="#222"/>
  <rect x="55" y="110" width="40" height="80" fill="#3a7bd5"/>
  <rect x="115" y="70" width="40" height="120" fill="#3a7bd5"/>
  <rect x="175" y="130" width="40" height="60" fill="#3a7bd5"/>
  <rect x="235" y="50" width="40" height="140" fill="#3a7bd5"/>
  <rect x="295" y="90" width="40" height="100" fill="#3a7bd5"/>
  <text x="75" y="205" text-anchor="middle" fill="#222">Mon</text>
  <text x="135" y="205" text-anchor="middle" fill="#222">Tue</text>
  <text x="195" y="205" text-anchor="middle" fill="#222">Wed</text>
  <text x="255" y="205" text-anchor="middle" fill="#222">Thu</text>
  <text x="315" y="205" text-anchor="middle" fill="#222">Fri</text>
  <text x="75" y="104" text-anchor="middle" fill="#222">40</text>
  <text x="135" y="64" text-anchor="middle" fill="#222">60</text>
  <text x="195" y="124" text-anchor="middle" fill="#222">30</text>
  <text x="255" y="44" text-anchor="middle" fill="#222">70</text>
  <text x="315" y="84" text-anchor="middle" fill="#222">50</text>
</svg>

<h2>Text color and no background</h2>
<p>The same drawing twice, with no background: first drawn in the text’s color, which a browser follows into dark mode, then drawn in black.</p>
<svg xmlns="http://www.w3.org/2000/svg" width="240" height="80" viewBox="0 0 240 80">
  <polyline points="10,70 50,10 90,70 130,10 170,70 210,10 230,40" fill="none" stroke="currentColor" stroke-width="4" stroke-linejoin="round"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="240" height="80" viewBox="0 0 240 80">
  <polyline points="10,70 50,10 90,70 130,10 170,70 210,10 230,40" fill="none" stroke="#000000" stroke-width="4" stroke-linejoin="round"/>
</svg>

<h2>Icon in a sentence</h2>
<p>A star <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="16" height="16" viewBox="0 0 16 16"><polygon points="8,1 10,6 15,6 11,9.5 12.5,15 8,11.5 3.5,15 5,9.5 1,6 6,6" fill="currentColor"/></svg> sits inside this sentence, hidden from VoiceOver, as a site’s decorative icon is.</p>

<h2>File as a picture</h2>
<p>An SVG file as a picture, with a width and a height, then the same file without them, then a file with a shape but no size of its own.</p>
<img src="svg/shapes.svg" width="320" height="160" alt="A red circle, a blue square, and a green triangle.">
<img src="svg/shapes.svg" alt="A red circle, a blue square, and a green triangle.">
<img src="svg/proportions.svg" alt="Four circles in a row: blue, green, orange, and red.">

<h2>Picture in a link</h2>
<p>An SVG file as a picture, inside a link to the file.</p>
<a href="svg/shapes.svg"><img src="svg/shapes.svg" alt="A red circle, a blue square, and a green triangle."></a>

<h2>Figure with a caption</h2>
<figure>
<svg xmlns="http://www.w3.org/2000/svg" width="300" height="200" viewBox="0 0 300 200">
  <circle cx="115" cy="80" r="60" fill="#3a7bd5" fill-opacity="0.5"/>
  <circle cx="185" cy="80" r="60" fill="#d9534f" fill-opacity="0.5"/>
  <circle cx="150" cy="135" r="60" fill="#5cb85c" fill-opacity="0.5"/>
</svg>
<figcaption>Three circles overlapping, each see-through.</figcaption>
</figure>

<h2>Script and animation</h2>
<p>Both squares are green unless a script ran: the drawing’s script turns the left one red, and its load handler the right one. The circle moves while the drawing animates.</p>
<svg xmlns="http://www.w3.org/2000/svg" width="300" height="100" viewBox="0 0 300 100" onload="document.getElementById('script-onload-square').setAttribute('fill', '#d9534f')">
  <rect id="script-square" x="10" y="10" width="80" height="80" fill="#5cb85c"/>
  <rect id="script-onload-square" x="100" y="10" width="80" height="80" fill="#5cb85c"/>
  <circle cx="220" cy="50" r="20" fill="#3a7bd5">
    <animate attributeName="cx" values="220;270;220" dur="2s" repeatCount="indefinite"/>
  </circle>
  <script>document.getElementById('script-square').setAttribute('fill', '#d9534f')</script>
</svg>

<h2>Markup in code</h2>
<p>An SVG drawing’s markup, written as code.</p>
<pre><code>&lt;svg width="16" height="16" viewBox="0 0 16 16"&gt;
  &lt;circle cx="8" cy="8" r="7" fill="currentColor"/&gt;
&lt;/svg&gt;</code></pre>
]]></content:encoded>
    </item>
  </channel>
</rss>
