I have the following code:
<a accesskey="b" class="icon icon-foo" href="/aa">this is a test</a>
CSS Code:
a {float: none;padding: 0 0 0 23px;}
.icon { display: block; overflow: hidden; background-repeat: no-repeat; width: 32px; height: 32px; background-image: url(http://www.burconsult.com/wp-content/uploads/2010/05/google_sprites_2.jpg); }
.icon-foo { background-position: 0 -35px; }
Code on JS fiddle http://jsfiddle.net/RD2Ph/
. I want the text to come to the right side of the image. i.e <image(blogger one)><my anchor text>
But right now the it is not happening with the above code. When I play with the above code either the image gets shifted or the text is shifted. Can you help me solve this?
http://jsfiddle.net/RD2Ph/2/
Get rid of
overflow: hiddenso the text shows up outside of the box bounds. Wrap it in a span so you can get at the text itself.display: block;and move it to the right withrelativepositioning.Update: Probably something more like this http://jsfiddle.net/RD2Ph/9/