Style Sheets
  Home arrow Style Sheets arrow Defining the Active State of Menu Sections...
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

Defining the Active State of Menu Sections for a CSS Sprite-Based Navigation Bar
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2010-03-03

    Table of Contents:
  • Defining the Active State of Menu Sections for a CSS Sprite-Based Navigation Bar
  • Review: defining the navigation bar's active and hover states
  • Defining the visual styles for the navigation bar's active state
  • Finish building the navigation bar

  • 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


    Defining the Active State of Menu Sections for a CSS Sprite-Based Navigation Bar


    (Page 1 of 4 )

    In this third part of a series, I put the final touches on our sample navigation bar, which uses the functionality of CSS sprites to define the visual presentation of the “normal,” “hover” and “active” states of its sections. Constructing a graphic user interface like this is a two-step process. First, one creates a good-looking background image, and then tweaks its X and Y coordinates via CSS.

    Originally coined in old the world of video games development, the term “sprite” has gone through a long rebirth process. Nowadays it’s used in web design for referencing a handy approach known as “CSS sprites,” which permits developers to create eye-catching, multi-state HTML elements directly manipulating a single background image.

    While the underlying logic of this styling technique makes it applicable in a plethora of contexts and situations, where CSS sprites actually leverage all of their “magic” is in the construction of attractive, standard-compliant navigation bars. What’s more, when coupled with some of the most popular image replacement methods available today, CSS sprites put in the hands of web designers a powerful tool that allows them to easily build all sorts of navigational systems that are highly responsive, and don’t require triggering a large number of HTTP requests to work as expected.

    Of course, I’m not saying that CSS sprites are a panacea that should be used on every possible occasion. As with many other web design techniques, it's a cardinal sin to abuse or misuse them. However, to demonstrate how useful they can be in specific cases, in the two articles that preceded this one, I started creating a stylish navigational bar whose sections were styled by employing only one background image, or expressed in other words, a set of CSS sprites.

    So far, in the articles in question I showed the CSS code required for defining the visual presentation of the “normal” and “hover” states of the sections that make up the navigational bar. It's still necessary to provide the bar with the ability to display the active states, so users can know quickly what section they’re currently viewing.

    Keeping this requirement in mind, the implementation of this additional feature will be discussed in the lines to come. To learn more about it, click on the link below and begin reading!

    More Style Sheets Articles
    More By Alejandro Gervasio


       · This chapter of the series goes through the definition via CSS sprites of the active...
     

    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