R
E
S
O
U
R
C
E
S
       Home      Products & Services      Contact Us      Links


WebHatchers will design & develop your site for you.
_______________________

Website Menu Heaven: menus, buttons, etc.
_______________________

Send us your questions.
_______________________

site search by freefind
_______________________

HOME
SEO, Google, Privacy
   and Anonymity
Browser Insanity
JavaScript
Popups and Tooltips
Free Website Search
HTML Form Creator
Animation
Buttons and Menus
Counters
Captchas
Image Uploading
CSS and HTML
PHP
AJAX
XPATH
Website Poll
IM and Texting
Databases—MySQL
   or Not MySQL
Personal Status Boards
Content Management
   Systems
Article Content
   Management Systems
Website Directory
   CMS Systems
Photo Gallery CMS
Forum CMS
Blog CMS
Customer Records
   Management CMS
Address Book CMS
Private Messaging CMS
Chat Room CMS
JavaScript Charts
   and Graphs




Free Personal Status Boards (PSB™)

Free Standard Free PSB

Free PSB Pro Version

Free Social PSB

Free Social PSB Plus (with Email)

Free Business PSB

Free Business PSB Plus (with Email)

PSB demo

Social PSB demo

Business PSB demo

So what's all this PSB stuff about?

Chart comparing business status boards

PSB hosting diagram

PSB Licence Agreement



Copyright © 2002 -
MCS Investments, Inc. sitemap

PSBs, social networking, social evolution, microcommunities, personal status boards
PSBs, social networking, business personal status boards
website design, ecommerce solutions
website menus, buttons, image rotators
Ez-Architect, home design software
the magic carpet and the cement wall, children's adventure book
the squirrel valley railroad, model railroad videos, model train dvds
the deep rock railroad, model railroad videos, model train dvds

More Tooltips Using CSS Only

What is really happening in this script is that an undisplayed block of text in a span is redisplayed when one hovers in the link that holds it in the page text. By the way, hover is a css pseudo-class that seems to act like an event but it isn't an event—it's just "lively" CSS. It is not the same as mouseover even if it acts like it.

The W3C (a.k.a. World Wide Web Consortium) did not really expect webmasters would be sticking tooltip spans into links and running them with hover. But the idea was just too creative for Eric A. Meyer (Pure CSS Popups) to resist. To tell the truth, we do find it kind of irresistable. But is it practical? Our guesstimate is that yes, as a fallback if people have their JavaScript turned off but a webmaster still wants to give them tooltips.

In the test code for css-only-tooltips-test.html below, the rectangular tooltip tester pops up a popup with text in it when you hover or scim over the underlined word. The tooltip will be superimposed upon the text below the tooltip triggering word(s). The script for tooltips-using-CSS-only.html does the same but cannot superimpose tooltips on other text. Instead, it makes the tooltips the same width as the text in the paragraph block and when it pops up, it forces the text in the div downward to accomodate the new row—a row which is the new tooltip. Once the tooltip trigger word is no longer hovered, all content goes back to its original form—moving up a row.

In the script below, we will use a span tag surrounding the tooltip text, and the span is in a link. But there are a few things you need to do to get it to work right. One is to add line breaks to adjust the width of the tooltip rectangle. Another is using relative positioning on the hover style for the link that encloses the tooltip trigger word(s), and absolute positioning on the hover style for the span inside the link that encloses the tooltip trigger word(s). Of course, the display property should be none on the span unless the hovering occurs, at which time you need the style property to be block. To deal with browser quirks, the CSS style white-space:nowrap should be added to the link's hover span style. Otherwise most browsers—except IE 6,7,8—will try to put the tooltip text words in a tall vertical column. Opera 10.63 and Opera Beta 11 need babysitting to deal with a bug we found. The bottom of tooltips are cut off if the tooltip is not displaying over other page text—which looks atrocious. It took a while to come up with a fix, but we had to remember that we couldn't use JavaScript to browser sniff. So we added something that would fix the problem in Opera and not be too nasty in other browsers. In the code, the span tag with the CSS of style='font-size:72px', then lots of nonbreaking spaces, then the end of the span tag—all this is the needed fix for Opera. Making the page longer with breaks did not work. There had to be characters, and these are what worked, since otherwise you would have to remember to never put tooltips in the bottom part of the page. With our method, it's all cross-browser and you need only remember to stick the span with the nonbreaking spaces at the bottom of the text area and you're good to go.

The website page http://www.fijiwebdesign.com/blog/css-tooltips-floating-html-elements.html (link no good) is the first place we saw relative positioning used correctly with css-only tooltips. Other tooltip popup related links: The Rectangular Tooltips Getting Data from .js File and the Rectangular Tooltips Getting Data from PHP File Using Ajax test pages will work on Windows IE 5.5, 6, 7, 8, Safari, Chrome, Firefox, Opera, and . . . that's all we tested, and the other scripts in this paragraph as well as the script below will work on these as well. Tooltips will just pop up, and follow the cursor in the 2 scripts just mentioned. If you want balloon tooltips that follow the cursor, you'll want Balloon Tooltips That Follow the Cursor, and if you want stationary balloon tooltips, you'll want Balloon Tooltips. The Rectangular Tooltips script does not get data from anywhere—the data is simply sent as a function parameter.

Now—on to the script code:

<html>
<head>

<style type="text/css">
<!--

a {border-bottom:1px solid blue;text-decoration:none;}

a:hover {position:relative;}

a span { display:none;}

a:hover span {display:block;position:absolute;top:10px;left:0px;padding:5px;
margin:10px;z-index:999; background:#eee;border:1px solid black;white-space:nowrap;}

-->
</style>http://www.fijiwebdesign.com/blog/css-tooltips-floating-html-elements.html
</head>
<body>
Here we go with <a href="#">CSS<span>Cascading Style Sheets are CSS</span></a>.
Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah <a href="#">CSS<span>Cascading Style Sheets are cool <BR>Cascading Style Sheets are hot</span></a>.
Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah <a href="#">CSS<span>blahhhhhhhhh <BR>blahhhhhhhhh <BR>blahhhhhhhhh<BR>blahhhhhhhhh <BR>blahhhhhhhhh <BR>blahhhhhhhhh<BR>blahhhhhhhhh <BR>blahhhhhhhhh <BR>blahhhhhhhhh<BR>blahhhhhhhhh <BR>blahhhhhhhhh <BR>blahhhhhhhhh</span></a>.
Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah <a href="#">CSS<span>hello hello hello hello hello hello hello <BR>hello hello hello hello hello hello <BR>hello hello hello hello hello hello <BR>hello hello hello</span></a>.
Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah <a href="#">CSS<span>hi and goodbye, bunky</span></a>.
Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah <BR><span style='font-size:72px'>&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;<BR></span><BR>
</body>
</html>