html – How to make background image not repeat itself

html – How to make background image not repeat itself

You could do something like this:

In the component (replace background with background-image:

<div  id=bg v-bind:style={ background-image: url( + require(./assets/2.jpg) + ) }>

And in the CSS:

div#bg {
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
    background-repeat: no-repeat;
    height: 100vh;
}

html – How to make background image not repeat itself

Leave a Reply

Your email address will not be published.