As I work on my website RedRoll.com, one of the tasks on my to-do list is implementing CSS sprites. (Don't forget to scroll down to see the scrolling container under "Exclusive!")
.simply-scroll-btn-left {
left: 0px;
top: 0px;
width: 34px;
height: 100%;
background: #000 url('https://www.redroll.com/wp-content/themes/steam/images/arrow-left.png') no-repeat center center;
background-size: 7px 12px !important;
}
Upon inspection, you can observe that there is a black backdrop behind the current arrow with dimensions 34px x 100%.
However, here's where I run into an issue. The specified width and height in the CSS definition creates this black container around it, which means altering the width/height of the icon in my sprite would also change the size of the container.
The question then arises - How can I maintain the consistent size of the black background while specifying the size of the icon? And furthermore, how can I ensure the sprite remains centered in the middle of the black background just like its current position?