Style Sheets
  Home arrow Style Sheets arrow Creating a Drop-Down Menu with the Hover C...
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

Creating a Drop-Down Menu with the Hover CSS Pseudoclass
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 2
    2009-12-23

    Table of Contents:
  • Creating a Drop-Down Menu with the Hover CSS Pseudoclass
  • Review: building a CSS-based tooltip
  • Developing a drop-down menu
  • Adding dynamic behavior with the hover CSS pseudoclass

  • 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


    Creating a Drop-Down Menu with the Hover CSS Pseudoclass


    (Page 1 of 4 )

    In this penultimate part of a four-part series, you will learn how to use the "hover" CSS pseudo-class to build a fully-functional, CSS-based drop-down menu. The process is fairly straightforward, so you shouldn’t have trouble using this technique when developing navigation bars for your own websites.

    Being an important part of the CSS specification, the "hover" CSS pseudo-class can be used for creating a great variety of visual effects on web pages. Best of all, you won't have to write a single portion of JavaScript code to use it this way. Unfortunately, in the past few years, its use has been reduced to styling only <a> HTML elements due to the poor support offered by Internet Explorer 6 and below.

    The good news is that nowadays, with more and more users upgrading to IE 7 and up, it's much easier to exploit the full capabilities provided by the "hover" pseudo-class and utilize it in other creative ways. In the previous tutorial I developed a hands-on example to demonstrate how to create fully-customizable tooltips by using the functionality of only one "hover" pseudo-class.

    Even though its driving logic was quite simple to grasp, this example hopefully showed you the real power behind this pseudo-class and how it can be used for  indirectly styling different CSS selectors with relative ease. However, if building pure CSS-based tooltips doesn't fulfill your expectations yet, let me tell you that "hover" pseudo-classes can be employed for creating more complex web page structures.

    Naturally, if you already read the article's title, you know what I'm tasking about here. By using a proper dose of clean markup and some CSS styles it's feasible to build a fancy drop-down menu, which will be displayed consistently on most major browsers.

    Provided that the subject has already caught your attention, in this third chapter of the series I'll be explaining how to create the aforementioned menu, whose driving force will be the venerable "hover" CSS pseudo-class. Let's get started!

    More Style Sheets Articles
    More By Alejandro Gervasio


       · This penultimate chapter of the series goes through building a fully-functional,...
     

    STYLE SHEETS ARTICLES

    - 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...
    - Decorating Line Numbers in Code Blocks Style...
    - Changing the Color of Code Lines with CSS
    - Using Ordered Lists to Style Code Blocks wit...
    - Using a Zebra Background Effect to Style Cod...
    - Displaying Rounded Corners Built with CSS3 i...
    - Building Rounded Corners with CSS3`s -webkit...







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