Фоновое изображение не отображается в CSS, хотя оно видно при проверке ⇐ CSS

Разбираемся в CSS
Гость
Фоновое изображение не отображается в CSS, хотя оно видно при проверке

Сообщение Гость »


У меня есть такое фоновое изображение:

Код: Выделить всё

body {
font-family: Nunito;
background-position: center;
background: url("/src/assets/graphic.png");
}
I can see in the inspect tab the background image is being applied and I can see the image itself when I hover over the path. However, on the page, nothing is being displayed. If I apply it to an img tag it works fine. I've tried changing background to background-image and applying widths and such with nothing working. I even compressed the image to see if that would work, but nope.
Изображение
However, when I change the image to a random one I found on google images it works:
Изображение
Any help? I'm entirely stuck on such a simple issue. The fact that the supposedly broken image works in an tag but not in the background-image property is driving me mad.


Источник: https://stackoverflow.com/questions/781 ... in-inspect

Вернуться в «CSS»