I want to set the background image of a div from the variable "imageUrl". I get the imageUrl from a variable in the js. The img src part of the html code works. But getting the variable into the style has not. Am I just not escaping the code correctly? Or not calling out the variable correctly? Here is my code:
<template>
<div class="slds-p-top_xxx-small" style="background-image: url('\'+imageUrl+\'');">
<p>
Your newer selected image is: <lightning-formatted-url value={imageUrl}></lightning-formatted-url>
<img src={imageUrl}>Test</img>
</p>
<h1>Your screenname is {screenName}</h1>
<h1>Your navLogic is {navLogic}</h1>
<h1>Your Component Text is {componentText}</h1>
</div>
Thanks!