<h1>Auto-Scaling an SVG Image with a <code>viewBox</code>
        <div>&mdash;watch out for IE and table layouts</div></h1>
<figure>
  <figcaption><code>img</code>, 100xauto height</figcaption>
  <div>
    <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/91525/potofgold.svg" style="width:100px">
  </div>
</figure>
<figure>
  <figcaption><code>img</code>, auto widthx50</figcaption>
  <div>
    <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/91525/potofgold.svg" style="height:50px">
  </div>
</figure>
<figure>
  <figcaption><code>img</code>, auto size</figcaption>
  <div>
    <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/91525/potofgold.svg">
  </div>
</figure>

External CSS

  1. https://codepen.io/AmeliaBR/pen/4f71235e7f30093e5c454baa65ad19e1.css

External JavaScript

This Pen doesn't use any external JavaScript resources.