|
Nicole -> CSS Tooltip problem... (3/14/2006 17:15:08)
|
Hi everyone, I have a problem with some tooltips I'm using on a medical related website and can't seem to find anything by searching online for a solution. In fact I haven't even been able to locate a site with a similar problem or one that has found a fix. I'm using tooltips for certain medical terms as they allow for a more detailed definition than the <acronym> element, the tooltips appear many times within each page as can be seen in the image below. You'll notice in that small image that there are about 4 tooltips (dashed underline) within a short section of a paragraph, this is typical of how often they appear within the site I'm working on. Anyway, I can't figure out how to make one tooltip appear over another underlined word, in other words the tooltip is appearing over the normal paragraph text but not over those words which are also tooltips. Any clues? Here is my CSS: p.tooltip {
color: #444;
font-size: 0.75em;
line-height: 1.5;
font-family: verdana, arial, helvetica, sans-serif;
font-weight: normal;
text-align: left;
background-color: #fff;
margin-top: 0.5em;
margin-bottom: 0.5em;
margin-left: 0;
margin-right: 0;
}
p.tooltip a {
position: relative;
color: #444;
border-bottom: 1px dotted #666;
text-decoration: none;
cursor: help;
z-index: 3;
}
p.tooltip a span {
display: none;
}
p.tooltip a:hover {
font-size: 100%;
text-decoration: none;
} /* IE/Win requires some link change on hover in order to show the tooltips */
a:hover span {
display: block !important;
position: absolute;
top: 5px;
left: 40px;
width: 160px;
border: 1px solid #7a052c;
background-color: #eee;
text-align: left;
color: #000;
padding-top: 5px;
padding-bottom: 10px;
padding-left: 10px;
padding-right: 10px;
font-size: 0.9em;
} and here is the html for that section in the image: <a href="#">"topical anesthesia"<span>Superficial loss of sensation in the mucous membranes or the skin, produced by direct application of a local anesthetic.</span></a>
for clear cornea <a href="#">cataract<span>Abnormal clouding or opacities within the lens of the eye.</span></a> surgery as part of her cataract surgery technique.</p>
<p class="tooltip">he is a graduate of the X of X of Medicine, receiving the Citation for graduating in the top 10% of her medical school
class. Dr. X was initiated into the Medical Society while still in his medical school training in Kansas. During
the completion of her <a href="#">ophthalmology<span>The branch of medicine that deals with the anatomy, functions, pathology, and treatment of the eye.</span></a>
residency training in X, he was voted "The Most Outstanding Third-Year Resident" by his peers.</p>
Also, another question, as you can see the once clean code has become quite messy with all of these tooltips scattered throughout the html. I was wondering whether there was a way to take out the "definition" part of the tooltip from the html and somehow "draw" that information from either the CSS or another page set aside for just the definitions? Thanks for reading these long winded questions. Nicole Edit: I should've turned the mouse on in the screenshot, but that tooltip refers to the first underlined word which is partially cut off. [image]local://upfiles/12879/E1CA82A939114E31BBEF8ED2AD08B7C8.jpg[/image]
|
|
|
|