title: How to draw a perfect diagonal with linear-gradient
body: <p>I am trying to draw a decent diagonal with <code>linear-gradient</code> but I can't figure out how to do it when the container is small> I am trying to get a diagonal that fits inside a 10x10px container and looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/S11yR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/S11yR.png" alt="enter image description here"></a></p>
  
  <p>This is my best attempt.</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>div {
    background: linear-gradient(50deg, transparent 4px, red 4px, red 5px, transparent 5px) no-repeat 0px 25px / 10px 10px;
    display:block;
    width:100px;
    height:100px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>What I am doing wrong?</p>