FARSHAD GH
FARSHAD GH

Reputation: 41

How to change a position of css sprite image?

I want change the image position to right side of text

padding: 0px 40px 0px 24px;
font: 14px arial,tahoma;
background: url(http://i1.someimage.com/pF0qaUw.jpg) no-repeat;
overflow: hidden;
background-position: -28px -34px ;
width: 16px;
height: 16px;
<div>text</div>

Upvotes: 0

Views: 559

Answers (1)

Sai Deepak
Sai Deepak

Reputation: 688

use it in this way

<div>Text &nbsp; <span class="sprite icon"></span></div>

and place it in the right side of the text

and use it like this

.sprite{background: url("sprite.png") no-repeat;display: inline-block;}
.icon{width: 50px;height: 50px;background-position: -50px -50px;}

Upvotes: 1

Related Questions