I have a webpage written in html and css as a prototype. Now we're implementing this using VueJS.
I want to have a picture as a background in the homepage. The problem is that I try to create a div
within the template, then style it from the style
part, but the picture doesn't come up. I tried linking the picture in an img
tag, and it shows which means that the page is correctly linked through the router, and the url is correct.
here is the code that I think is supposed to work:
.background {
background-image: url(../assets/img/21.jpg);
width: 100%;
}
<template>
<div>
<div class="background"></div>
</div>
</template>
I tried to follow with the answers given here but they made no difference.
am I missing something or what exactly is wrong here?