Home>

Please write your question in detail here.

I created a web page header using HTML5 and CSS3
However, using url () for the background-image in the header,
I specified, but the image is not reflected.
The name of the image is in the same folder as this file

It ’s called h.jpg
I don't understand the error message gen204: 1

Error message

Failed to load resource: gen204: 1
net :: ERR_FILE_NOT_FOUND

Applicable source code
.header {
  height: 95vh;
  background-image: linear-gradient (to right bottom, rgba (126, 213, 111, 0.8),
  rgba (40, 180, 131, 0.8),
  url (h.jpg);
  background-size: cover;
  background-position: top;
}
Tried

Change the name of the image,
I changed the name of the html folder

  • Answer # 1

    This seems to be the reason that Mts10806 pointed out for the image
    The meaning of "gen204: 1" cannot be asserted, but204404 Not Found/code>, which means that "communication was possible but there was no data to return", so it also matchesnet :: ERR_FILE_NOT_FOUND, so I think that is the meaning

    By the way, CSS,
    linear-gradient ()'s ")" is missing, so
    The value set for thebackground-imageproperty is
    "linear-gradient (to right bottom, rgba (126, 213, 111, 0.8), rgba (40, 180, 131, 0.8), url (h.jpg);background-size: cover;background-position : top;}"

    If another style is described afterwards, as in the image below, it will be recognized as the value ofbackground-image. Both do not work

    Like HTML, don't forget to close it


    When specifying a path, not limited to images
    In most cases, specify either "absolute path", "relative path", or "root relative path"
    Please refer to the following for how to write

    What is the difference between absolute path, relative path and root path? What are the advantages and disadvantages?

  • Answer # 2

    If you specify a file from css, it must be the path from that css,
    It may be because there are no images in the same folder as css.
    Although it is specified variously in background-image, I think that it is more certain that if CSS is specified, only the url that uses external resources is specified and it moves as expected and other specifications are entered.

Related articles