title: Create a perfect dashed line with background-image in CSS
body: <p>I would like to have a dotted line below to a text :</p>
  
  <p><a href="https://i.stack.imgur.com/ncwYj.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/ncwYj.jpg" alt="enter image description here"></a></p>
  
  <p>The web designer have designed a custom dotted so i can’t use :</p>
  
  <pre><code>h2 {
      border-bottom: 4px dashed #fff;
      display:table;
  } 
  </code></pre>
  
  <p>because it is not conform.</p>
  
  <p>What i’ve done : I’ve made an image with a dot and position it with css :</p>
  
  <pre><code>h2 {
      padding-bottom: 20px;
      display:table;
      background-image: url('../images/tiret.png');
      background-repeat: repeat-x;
      background-position: center bottom; 
  }
  </code></pre>
  
  <p>It works very well but depending on the width of the text, the last dot could appear cut like you can see on this picture :</p>
  
  <p><a href="https://i.stack.imgur.com/q43tZ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/q43tZ.png" alt="enter image description here"></a></p>
  
  <p>Do you have a suggestion on how to avoid this ?</p>