I'm trying to set a background image for the images preview of a gallery and nothing is shown. I'm using:
echo '<div class="prev" style="background-image:url(' . $image . ')"></div>';
In addition the prev class is:
.prev {
width:120px;
height:90px;
background-size:cover;
background-position:center;
}
$image variable is ok, I echoed it for test, and when I put the same url (this echo) in a div not written by php, the image is shown perfectly.