I’m a guitar player, not a coder…but I have a guitar lesson site. Anyway, in the code below, I’m trying to get the BOTTOM of the tooltip to always be just above the line it hovers over. It should behave this way regardless of the amount of text in the tooltip, and regardless of the length of the the text in the line it hovers over. (I tried using “margin-bottom:” but it didn’t work at all for me.) If I’m doing it the wrong way or in a very messy way I wouldn’t be surprised. (First time to try posting code…hope it works.) Thanks.
<style type="text/css">
.toolTipDiv {
float: none;
width: 275px;
margin-left: 20px;
}
.toolTipLink a {
display: block;
color: #202020;
background-color: transparent;
width: auto;
padding: 0px 10px;
text-decoration: none;
font-size: 12px;
margin-left: 0px;
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: #878787;
line-height: 17px;
}
.toolTipLink a:hover {
background-color: #ddd;
color: #9B0E11;
padding-left: 10px;
}
a.tooltip span {
z-index: 10;
display: none;
padding: 7px 10px;
margin-top: -80px;
/* this doesn't do anything:
margin-bottom: [any value]px;
*/
margin-left: 200px;
width: 140px;
line-height: 16px;
opacity: 0.85;
}
a.tooltip:hover span{
display:inline;
position:absolute;
color:#EEE;
background:#000
repeat-x 0 0;
}
</style>
<body>
<p> </p><p> </p><p> </p><p> </p>
<div class="toolTipDiv">
<span class="toolTipLink">
<a href="_lessons/_beginner/054-Basic-Boogie-Rock.html" target="_blank" class="tooltip">
<div class="tooltipWrapper">
<div class="toolTipEdge">Medium amount of text in this line.</div>
<span>I want the bottom of every tooltip to be at the top of every line it hovers over.</span>
</div>
</a>
<a href="_lessons/_beginner/054-Basic-Boogie-Rock.html" target="_blank" class="tooltip">
<div class="tooltipWrapper">
<div class="toolTipEdge">This is the text that will be hovered over. Sometimes it may be this long</div>
<span>The bottom of this tooltip is too low. It should be just above the line.</span>
</div>
</a>
<a href="_lessons/_beginner/054-Basic-Boogie-Rock.html" target="_blank" class="tooltip">
<div class="tooltipWrapper">
<div class="toolTipEdge">Here is a shorter line of text.</div>
<span>Sometimes the text in the "tooltip" will be a couple sentences long. If the tooltip text is ong or if it is short, the bottom of the tooltip should be right above the hovered line.</span>
</div>
</a>
<a href="_lessons/_beginner/054-Basic-Boogie-Rock.html" target="_blank" class="tooltip">
<div class="tooltipWrapper">
<div class="toolTipEdge">Medium amount of text in this line.</div>
<span>This tooltip is way too high.</span>
</div>
</a>
</span>
</div>
</body>