Following an HTML tutorial, running the code on VSCODE, but when I tried to run on google, the background picture that I specified in my style.css script does not show; I only see white. I have also just started using VsCode, so I could be doing something wrong with the run/debug process.
I tried adding and removing double-quotes, adding using different links, and running/debugging from VsCode.
5
Answers
maybe you are wrong when using url()
https://developer.mozilla.org/en-US/docs/Web/CSS/background-image
check if the url of image right or not,
i will share with you this code and it will work:
i hope this will help u.
Your attached image does not show CSS
are you using background image for header or body?
as others mentioned you did not provided proper code, Just wanted to mention point assuming you have applied background image properly in CSS
does your style.css has proper path which has this that file?
if the div for which you have applied background image does not have height for width it will not appear in browser so mention some height and width or add content
you can always use browser developer tools to inspect and check if the css you have written are properly applied or not and does that div/tag has content or width height
image does not help us to check and guide you have uploaded image showing HTML but asking questions about CSS
the problem here is simple. And it’s that you’re using the wrong syntax for the
background-image
property. Yoururl()
is insidelinear-gradient()
.Change your
background-image
property to this, hopefully, you’ll get desired results.the background is a shortcut for the other properties like -image -size -repeated and so on, so you can combine the URL with the background like this:
also note you should add single or double quotes for the url()