probey20
02-02-2007, 02:18 PM
Hi,
I'm coding pure CSS tooltips using an XSL transformation. Each definition is stored in a hidden span when the page loads and displayed when you mouseover specific words. The problem I'm having is that long tooltips are getting cut off at the bottom of the browser window.
Does anyone know how to fix this? I'd like the tooltip to "float" up above the bottom of the browser window. I'm trying to avoid using JavaScript, but I am open to using JavaScript within the CSS if necessary. Thanks!
HTML:
<a href="#" class="tooltip">accident<span>A sudden unexpected event, identifiable in time and place. In some policies, accident means the same as occurrence.</span></a>
CSS:
a.tooltip, a.tooltip:visited {z-index:24;color:#336666;position:relative;border-bottom:1px dashed #336666;text-decoration:none;}
a.tooltip:link, a.tooltip:hover, a.tooltip:active {z-index:25;color:#336666;border-bottom:1px dashed #336666;text-decoration:none;cursor:help;}
a.tooltip span {display:none;}
a.tooltip:hover span {position:absolute;top:2em;left:0em;border:1px solid #F0D070;padding:3px;display:block;width:245px;color:#D0A010; background-color:#FFFFE4;font-weight:normal;}
I'm coding pure CSS tooltips using an XSL transformation. Each definition is stored in a hidden span when the page loads and displayed when you mouseover specific words. The problem I'm having is that long tooltips are getting cut off at the bottom of the browser window.
Does anyone know how to fix this? I'd like the tooltip to "float" up above the bottom of the browser window. I'm trying to avoid using JavaScript, but I am open to using JavaScript within the CSS if necessary. Thanks!
HTML:
<a href="#" class="tooltip">accident<span>A sudden unexpected event, identifiable in time and place. In some policies, accident means the same as occurrence.</span></a>
CSS:
a.tooltip, a.tooltip:visited {z-index:24;color:#336666;position:relative;border-bottom:1px dashed #336666;text-decoration:none;}
a.tooltip:link, a.tooltip:hover, a.tooltip:active {z-index:25;color:#336666;border-bottom:1px dashed #336666;text-decoration:none;cursor:help;}
a.tooltip span {display:none;}
a.tooltip:hover span {position:absolute;top:2em;left:0em;border:1px solid #F0D070;padding:3px;display:block;width:245px;color:#D0A010; background-color:#FFFFE4;font-weight:normal;}