title: How to use asset URLs in style binding with Vite
body: <p>I want to show a background image from my assets folder. When I use an image tag, the image is shown properly, so the image is well placed, but throws a 404 when I use the <code>background-image</code> style. Any idea about what is happening?. I am using Vue 3 with TypeScript and Vite 2.</p>
  <p>This does not resolve the URL:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;div style=&quot;background-image: url(./assets/img/header.png)&quot;
  &gt;&lt;/div&gt;
  </code></pre>
  <p>But this does:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;img src=&quot;./assets/img/header.png&quot; alt=&quot;Header&quot; /&gt;
  </code></pre>