View Full Version : div/spans within links

Feb 21st, 2007, 03:00 AM
im using a tool-tip that has a span/div within an <a> and it doesnt validate... how do i work the tooltip then?

Feb 21st, 2007, 03:08 AM
What is the tool-tip going to be for, that you had to place it in an <a> tag?

Feb 21st, 2007, 03:24 AM

<a class="stats" href="#">
<img src="images/visitors.png" alt="Visitors" title="Visitors"/>
<?php include('modules/counter/counter.php'); ?>


echo "
<table cellpadding=\"0\" cellspacing=\"0\">

tool-tip pops up and displays some data from PHP that is tabular when i mouse over the image... but it doesnt validate if use tables, divs to display the data

Feb 21st, 2007, 03:25 AM
And what's in counter.php?

Feb 21st, 2007, 03:35 AM
the only relevant output is in the second code block shown above

gah, i cant even use <pre> tags.. sob!

Feb 21st, 2007, 03:40 AM
I don't see anything for tooltips? Why's the image got a link that goes nowhere? Why are you trying to make a table a link.

Unless you're wanting what's shown in the table to appear at the 'title' text?

Feb 21st, 2007, 03:45 AM
i don't think we are on the same page... at all

the image is a link, yes
it goes no where, yes

it acts as a container such that whenever the mouse goes over the image (which is now link) it creates the tool-tip... there is CSS on the back end to control that but since the CSS has nothing to do with the validation i didn't include it

as of right now it validates if i use alot of &nbsp; to space everything out

Feb 21st, 2007, 03:56 AM
What I was trying to get at is, why you need the table in the link in the first place. Without knowing a reason why you needed it there, it's hard to give you a solution. Now you have said why and how it works, it'll help people give you an answer to your problem.

Feb 21st, 2007, 04:06 AM
theres (http://www.crystaltech.com/forum/topic.asp?TOPIC_ID=12843) the CSS

i need the table in between the two span tags b/c its between those two tags that the content of the tool-tip resides... instead of just displaying some predefined text i need it to be dynamic statistics

if you look at my php portion you'll see where im trying to output site statistics (which is tabular data and belongs in a table), however you cant have a table or anything really within the a<span construct

Feb 21st, 2007, 05:27 AM
Why does it need to be a table inside the tooltip?

echo 'yesterday' :' . "$yesterday" . '<br />';
echo 'today :' . "$today" . '<br />';
echo 'tomorrow' :' . "$total" . '<br />';

I am familiar with the tool tip techniques displayed. I use the tooltip as an Image holder and as linkable tooltips.
I have not tried this code, but I don't see why it wouldn't work. The php is simply writing text values into the span.
The problem might be parsing the code for tables inside the span, don't know. I do know that I haven't ever figured out a method to have an Anchor tag inside that span, so maybe the problems are similar.

brother wolf
Feb 21st, 2007, 06:11 AM
You say it is tabular data but it could also be thought of as a list of stats. So how about making it like a dropdown menu just with stats instead of links in the dropdown.

<ul id="nav">
<li><a href="#"><img src="visitor.png" alt="Visitors" title="Visitors"/></a>
<li>Today: 0000</li>
<li>Yesterday: 0000</li>
<li>Total: 0000</li>

#nav, #nav ul {padding: 0;
margin: 0;
list-style: none;}

#nav a {display: block;
width: 10em;}

#nav li {float: left;
width: 10em;}

.right {text-align: right;}

#nav li ul {position: absolute;
width: 10em;
left: -999em;
border: 1px solid black;}

#nav li:hover ul {left: auto;}
I just modified a son of suckerfish menu. It works in FF but you have to add JS for IE.