Answer the question
In order to leave comments, you need to log in
How to set an image (slider button) via CSS sprite if the button is styled only via css?
I created a sprite using an online generator. Here's what happens.
HTML
<i class="sprite sprite-ar-menu"></i>
<i class="sprite sprite-ar-slider"></i>
<i class="sprite sprite-ar_head"></i>
....... .sprite {
background-image: url(spritesheet.png);
background-repeat: no-repeat;
display: block;
}
.sprite-ar-menu {
width: 7px;
height: 5px;
background-position: 0 0;
}
.sprite-ar-slider {
width: 16px;
height: 31px;
background-position: -7px 0;
}
.sprite-ar_head {
width: 11px;
height: 7px;
background-position: -23px 0;
}
........... #owl-one .owl-prev {
background: url(../img/ar-slider.png) no-repeat;
width: 16px;
height: 31px;
position: absolute;
right: 20px;
top: calc(50% - 16px);
}
#owl-one .owl-next {
background: url(../img/ar-slider.png) no-repeat;
transform: rotate(180deg);
width: 16px;
height: 31px;
position: absolute;
left: 20px;
top: calc(50% - 16px);
}
<i class="sprite sprite-ar-menu"></i>
<i class="sprite sprite-ar-slider"></i>
.sprite-ar-slider {
width: 16px;
height: 31px;
background-position: -7px 0;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question