title: Why am I able to add margins to images in css although images are inline element?
body: <p>I had read somewhere that since images are inline elements, margins can't be added to them. Using the following code, I was able to add margins to my images. Why is it so?</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>img {
    width: 200px;
    margin: 100px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div&gt;
    &lt;img src="https://picsum.photos/200/300" alt="" /&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>