How to add a background image in Style Tag in Vuejs

After you have created your Vuejs project, you need to add a background image.

Let’s assume your HomePage.vue component has this content:

Adding background images on the style tag in this component did not make the background display on the browser. More so, I got a 404 error (Not Found)

However, adding it in the App.vue file, below the template tag displayed the result on the browser.



Developer and an occasional foodie

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store