Style Sheets
  Home arrow Style Sheets arrow Building CSS-based Tooltips with the Hover...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
STYLE SHEETS

Building CSS-based Tooltips with the Hover Pseudoclass
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 3
    2009-12-21

    Table of Contents:
  • Building CSS-based Tooltips with the Hover Pseudoclass
  • Review: highlighting web page containers using hover CSS pseudo-classes
  • Building CSS-based web page tooltips
  • Adding some CSS styles to the structural markup

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Building CSS-based Tooltips with the Hover Pseudoclass


    (Page 1 of 4 )

    In this second installment of a four-part series, I demonstrate how easy it is to build a basic tooltip using only the functionality provided by the “hover” CSS pseudo classes. The technique you'll see here will work with newer versions of IE, Firefox, Google Chrome and other browsers.

    Even though CSS pseudo-classes have been available for a long time, the inability for Internet Explorer 6 and below to support them with selectors other than mere <a> elements has imposed considerable constraints on leveraging their full potentiality.

    In the specific case of the "hover" pseudo-class, which can be used for defining the visual presentation of a given HTML element when the mouse is placed over it, this restriction has been a harsh torture for many web designers. They chafed at their possibilities being limited to applying CSS-based hovering effects only to individual inline links, or in the best cases, to entire navigation bars.

    However, this frustrating scenario has started to change. With the release of IE 7 and 8, both of which offer a decent support for "hover" pseudo-classes for most web page elements, it's possible to create rollover effects that will be displayed consistently by most modern browsers.

    To illustrate how useful CSS "hover" pseudo-classes can be when assigned to multiple HTML elements asides from simple hyperlinks, in the introductory part of this series I built an example that showed how to use them for dynamically changing the background color of different divs on a web page in response to a "mouseover" event.

    While this first example was quite rudimentary indeed, it revealed the remarkable potential of "hover" pseudo-classes when employed in more creative ways. Of course, highlighting sections of an (X)HTML document without using JavaScript may seem at first sight a minor task, but this is a misleading opinion, believe me.

    In reality, "hover" pseudo-classes can be used for styling "indirectly" (if the term is really applicable) several selectors, which permits developers to add a dynamic behavior to elements of a web document without relying on client-side scripting at all. That sounds pretty interesting, right?

    In the lines to come I'll be showing how to take advantage of the functionality given by "hover" pseudo-classes for building pure CSS-based tooltips, which you'll be able to tweak and customize according to your personal preferences.

    Ready to learn the ins and outs of this styling process? Then let's get started!

    More Style Sheets Articles
    More By Alejandro Gervasio


       · This second installment of the series demonstrates how easy it is to build a basic...
     

    STYLE SHEETS ARTICLES

    - Styling HTML Lists with CSS: Manipulating Pa...
    - Styling HTML Lists with CSS: Specifying Pad...
    - Styling HTML Lists with CSS: Resetting Paddi...
    - Absolute Positioning in CSS: a Dynamic Menu
    - CSS Absolute Positioning: Creating a Quick S...
    - CSS: Building Tooltips with Absolute Positio...
    - Styling Pseudo Classes with the RGBA CSS3 Pr...
    - Controlling Overall Transparency of an HTML ...
    - Altering the Border Opacity of an HTML Eleme...
    - The RGBA CSS3 Property: an Overview
    - Using Span Tags to Include Logos in Web Pages
    - Using a Single H1 Element to Include Logos i...
    - Combining Divs and H1 Elements to Include Lo...
    - Semantically Including Logos in Web Pages
    - Adding Text Indentation to Style Code Blocks...







    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek