Reputation: 638
I am trying to use sprites for a webpage but I don't know how to work with images being double resolution. Can you pls help?
So far I am using:
.div {
display: block;
margin: 0 auto;
width: 200px; ---> they remain 400px;
height: 200px; ---> they remain 400px;
background: url(Sprite.png) 10px 0;
}
The problem is that images still show too big. Not sure how to scale them down.
Thanks
Upvotes: 1
Views: 24
Reputation: 7711
You can specify the size of the background images by using the background-size
property as shown in the example at https://www.w3schools.com/cssref/tryit.asp?filename=trycss3_background-size.
Upvotes: 0