The embarrassing typo is actually in my original code, I looked at it enough times but somehow missed it. However, correcting it didn't help. Still no image.
When you look at the source code of the page using the Chrome browser, you can see that the url is being inserted:
First, try loading the URL directly to see if the image exists and is publicly accessible.
Next, inspect the <div> and see if it has a height - you say it's a flexbox - so you might need to set height (or min-height) if there's no content in it.
Bo - thank-you, switching the quotes for apostrophes worked. I had tried that, but of course I now realise that the last time I tried it I still had the 'backround' typo so it didn't work. Doh.
Div background-image not displaying
Hi,
Does anyone have any idea why:
is not displaying an image, when:
does work? Div is a flexbox, if that helps.
Thanks, Alistair
Hi Alistair,
It might just be because of the typo - you have
backround-image
instead ofbackground-image
(missing a 'g').If that's not the case, let us know and we'll see what we can do to help you debug it...
/Chriztian
Hi Chriztian,
The embarrassing typo is actually in my original code, I looked at it enough times but somehow missed it. However, correcting it didn't help. Still no image.
When you look at the source code of the page using the Chrome browser, you can see that the url is being inserted:
but still no image on the page.
Cheers, Alistair.
Hi Alistar.
try
Alright,
<div>
and see if it has a height - you say it's a flexbox - so you might need to setheight
(ormin-height
) if there's no content in it./Chriztian
Hi,
Bo - thank-you, switching the quotes for apostrophes worked. I had tried that, but of course I now realise that the last time I tried it I still had the 'backround' typo so it didn't work. Doh.
Chriztian, thanks for your help too.
Regards, Alistair
is working on a reply...