I'm struggling to come up with a way that I can achieve the following, I thought about it logically, and I'm sure I can't do it without javascript (jQuery).
I just wanted to know if anyone has clever CSS tricks that will achieve what I'm trying to achieve.
To the description :-). I am trying to vertically align a div with span , where the div may have different heights depending on the content. Please see the image below to better understand what I would like to do:

This is my starting point. for the code (please forgive minification, as I type).
HTML:
<ul> <li><a href="address" title="no need for this as custom tooltip will replace">Link Text here</a> <div class="tooltip"><span>Description of the link here</span></div> </li> <li><a href="address">Link 2 Text here</a> <div class="tooltip"><span>Description of the link here</span></div> </li> </ul>
CSS
ul {list-style-type:none;margin:0;padding:0 0 0 30px;overflow:visible;} li {position:relative;border:1px solid #000;margin:5px 0;} li a {font-size:14px;} li .tooltip {position:relative;margin-left:100px;width:140px;padding:10px;font-size:12px;background-color:#fff;border:1px solid #999;border-radius:4px;z-index:10;}
UPDATE
Please do not post any answers to jQuery or javascript (or any css code that shows or hides the tooltip), I can write it myself. I just want to know if this can be done using CSS. The functionality of the tooltip doesnβt matter here, I just want to hear your opinions / solutions on my alignment problem :-)
Ben carey
source share