Viewing 1 post (of 1 total)
  • Author
    Posts
  • #151942
    tanotu
    Participant

    I added a media upload button for an image in the inspector. Now I would like to add this image as a background-image to my <div> like this:
    style={ { backgroundImage: url(${ imgURL }) } }

    but the style tag should only appear in frontend, if an image is selected. So I thought this could work with some conditional logic:
    style={ imgURL ? { backgroundImage: url(${ imgURL }) } : none }

    but now I get the error message that the block validation failed. Does anyone have any idea how to solve this?

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.