A response given by Amar Syla is accurate, but it fails to identify the original issue at hand. It is true that the shorthand syntax for the background
property is correct, as mentioned. However, if a specific property is not specified, the browser defaults to its own property. Therefore, in this scenario, the lack of the background-color
property is inconsequential. This can be observed in the following code snippet (where background-color
is omitted, yet background-image
displays correctly):
div {
background: url('http://www.planwallpaper.com/static/images/desktop-year-of-the-tiger-images-wallpaper.jpg') top left no-repeat;
height: 300px;
background-size: 100%;
}
<div></div>
The actual issue lies in the image path within your code. According to the folder structure depicted in the screenshot, the correct path should be:
background: url('../images/home1.jpg') top left no-repeat; /*Correct path*/
instead of
background: url('/../images/home1.jpg') top left no-repeat; /*Wrong path*/
I hope this clarification helps!!!