I have managed to display a sprite image within a span tag. The span is nested inside other elements such as
<div>, <li>, <p>
. The parent elements of the span have their text alignment set to center.
The text content of the parent elements aligns correctly in the center. However, I am facing difficulty in centering the span with the sprite image.
Below is a sample of the code I have used:
HTML Markup:
<div align="center"><span class="cameraIcon spriteImage"></span>Some Text Content</div>
Style
span.cameraIcon {
background-position: -240px 0;
width: 24px;
height: 24px;
position: absolute
}
Any suggestions on how to improve this would be greatly appreciated.
Thank you!