Reputation:
I added a background image and it is not visible in the page.
This is what i tried:
Css:
div{
background: url(http://patentimages.storage.googleapis.com/CN103289961A/CN103289961AD00172.png) no-repeat center center fixed;
-webkit-background-size: contain;
-moz-background-size: contain;
-o-background-size: contain;
background-size: contain;
vertical-align: middle;
background-position: center;
}
Upvotes: 0
Views: 47
Reputation: 1087
It is because the div does not have measures width and height fixed or defined.
background: url(http://patentimages.storage.googleapis.com/CN103289961A/CN103289961AD00172.png) no-repeat center center fixed;
-webkit-background-size: contain;
-moz-background-size: contain;
-o-background-size: contain;
background-size: contain;
vertical-align: middle;
background-position: center;
width: 500px;
height: 500px;
}
Working link
Upvotes: 3