score:1

Accepted answer

oh man, you're so close! it's not a pathing issue but a css issue. when using background image in a css file, it would look like this:

background-image: url(/images/borealis.jpg);

in what you have now it looks like you just missed the url part. so it will work if you change it to this:

const fondoborealis = {backgroundimage: 'url(/images/borealis.jpg)'};

and to use it you would do this (with one set of curly braces. there are two sets in your current code):

style={fondoborealis}

score:0

var co_img = "/images/borealis.jpg";
const sheshema = {
  backgroundimage: "url(" + co_img + ")"
}
<div style={sheshema}>
 </div>

this should work. try it.


Related Query

More Query from same tag