title: Cannot set property of undefined CSS DOM
body: <p>My JS:         <code>document.getElementsByClassName('main').style.backgroundColor = '#101521';</code></p>
  
  <p>My HTML:</p>
  
  <pre><code>&lt;html class= 'main'&gt;
    &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;title&gt;Widg-It&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;span id="close"&gt;X&lt;/span&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Im trying to make the background of my webpage the color '#101521' using CSS DOM</p>
  
  <p>I run the code and I get the error: "cannot set property of 'backgroundColor' of undefined"</p>
  
  <p>I do not know what this means, and how to make it work.</p>