Что я могу сделать, чтобы поместить фоновое изображение спрайта внутри контейнера? ⇐ CSS

Разбираемся в CSS
Гость
Что я могу сделать, чтобы поместить фоновое изображение спрайта внутри контейнера?

Сообщение Гость »


I have a sprite image which is a contian of two images. But they are always bigger than the container, I want to fix/put them inside the parent container. How can I fit images without increasing parent size?


Изображение


HTML:
CSS:

Код: Выделить всё

.affiliate-sprite-60 { background:url('affiliate-sprite.jpg') 0px -1px; width:799px;height:440px; display:inline-block; } .affiliate-sprite-40 { background:url('affiliate-sprite.jpg') -799px -0px; width:783px;height:441px; display:inline-block; } div { width: 600px; border: 2px solid red; } 
This is the original image:
Изображение



Источник: https://stackoverflow.com/questions/781 ... -container

Вернуться в «CSS»