title: How to create a Slanted Background with CSS?
body: <p>I've attached a picture to show the exact layout. The line in the photo is only there to show where the colors should change. </p>
  
  <p>Here is some code I have tried but doesn't look how I want. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.block {
    background-color: black;
    left: -50;
    height: 150px;
    width: 100%;
    transform: rotate(-40deg);
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;body&gt;
    &lt;div class="block"&gt;
  
    &lt;/div&gt;
  &lt;/body&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><a href="https://i.stack.imgur.com/gLAas.png" rel="noreferrer"><img src="https://i.stack.imgur.com/gLAas.png" alt="enter image description here"></a></p>