**CSS**
Why my CSS Background Shorthand Property does not work .I have applied many processes ,But it’s not working.
**CSS stylesheet**
*{
padding: 0;
margin: 0;
}
.container{
width: 800px;
height: 800px;
margin: 0 auto;
border: solid 2px;
background: red url(image/computer.png) no-repeat cover fixed;
}
**HTML code**
<div class="container">
</div>
>Solution :
Two problems you have to fixed:
You doesn’t have the "" for the url.
You have to separately set the background-size:cover property.
Set it in the background will not work.
*Not sure if image/computer.png is a local image or an invalid image. If it is a local image, just replace the url back (I change the url to wikipedia icon for showing purpose)
*{
padding: 0;
margin: 0;
}
.container{
width: 800px;
height: 800px;
margin: 0 auto;
border: solid 2px;
background: red url("https://upload.wikimedia.org/wikipedia/commons/thumb/8/80/Wikipedia-logo-v2.svg/2244px-Wikipedia-logo-v2.svg.png") 0 0 no-repeat fixed;
}
<div class="container">
</div>