Previous Message
Next Message

Inline image - shift

Sent by Sam Carter on 10 March 2005 20:08


I've seen the following problem handled nicely in <div>s, but how about 
inline elements?

<a href=""><img src="myfile" class="myclass"></a>

What I'd like to do is load a single image icon for the above link, the 
image will be 14px wide by 28 px high. I'd like to show 14px by 14px of 
the image and move the background-position to show the other half of the 
image by changing the CSS appropriately.

I am stumped on how to do this with pixel accuracy (maybe it isn't 
possible) with an inline element. The various height controls 
(line-height, height, padding, margin) leave me no confidence that I 
could create a 14px by 14px transparent element for the anchor tag 
inline element to which I can apply the background image using CSS.

Has anyone seen a solution for this problem?

Sam



______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread: