|I'm having a helluva time setting a background image. In the firefox dev console, I get this:
The image “https://localhost:44306/Images/banner_background2.jpg” cannot be displayed because it contains errors.
I'm using the bootstrap jumbotron and overriding that class to my site.css file, and it can't seem to find the image I'm specifying. Since it was in the css file, I couldn't use
I also tried setting the style in the div, but that doesn't seem to be working either.
This is what I have right now (in Index.cshtml):
<div class="jumbotron" style="border-radius:0.75rem; background:no-repeat url('../Images/banner_background.jpg');">
... some content
Intellisense guided me to the image file, so I don't understand what I'm doing wrong. The div is about 250px tall. I've tried to use quotes around the filename, and no quotes, and I've also tried to use a tilde instead of
Just for grins, I tried opening the image with firefox from windows explorer, and it opens fine.
It turns out that for an ASP.Net Core web app, images have to be placed into a folder in the wwwroot directory. That's the only way I could get it to work... WTF?
".45 ACP - because shooting twice is just silly" - JSOP, 2010
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
modified 2-Nov-21 10:00am.