JJ wrote:

I need to display a map legend. This consists of a vertical list of images with a text explanation (never more than a few words) immediately to the right of each image. What is best way to display the image (26px tall) and then the text (about 12px tall) on the same line, with the text vertically aligned at the middle of each image?
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
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/

I don't think it would be appropriate in this case, because the images have semantic meaning, but if I wanted to do this, I'd probably put the image in the background of a tag that surrounds the text. Then give it a line-height larger than the image, use vertical-align: middle, and enough left padding that the text doesn't flow over the image, and you're good to go. 3px center for background-position should do the trick.

It bears repeating: if you want to do it this way, make sure the line-height is larger/as large as the image, or the image'll get chopped off.

--
http://www.mozilla.org/products/firefox/ - Get Firefox!
http://www.mozilla.org/products/thunderbird/ - Reclaim Your Inbox!

Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html

______________________________________________________________________
css-discuss [EMAIL PROTECTED]
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/

Reply via email to