Home arrow Style Sheets arrow Page 3 - Finishing a Drop-Down Menu with the Hover CSS Pseudoclass
STYLE SHEETS

Finishing a Drop-Down Menu with the Hover CSS Pseudoclass


In the last few months, “hover” CSS pseudo-classes have gone through a rebirth process that allows us to evaluate their actual functionality from a new and fresh point of view. This article series shows you how to unlock their potential. In this last part of the four-part series, we'll finish building the drop-down menu that we began in the previous part.

Author Info:
By: Alejandro Gervasio
Rating: 4 stars4 stars4 stars4 stars4 stars / 2
December 29, 2009
TABLE OF CONTENTS:
  1. · Finishing a Drop-Down Menu with the Hover CSS Pseudoclass
  2. · Review: building a customizable drop-down menu using CSS pseudo-classes
  3. · The drop-down menu's Service and Contact sections
  4. · The drop-down menu's full source code

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Finishing a Drop-Down Menu with the Hover CSS Pseudoclass - The drop-down menu's Service and Contact sections
(Page 3 of 4 )

In reality, adding a couple of additional sections to the previous drop-down menu is a very simple task. It only requires modifying the structural markup. Fortunately, in this case it's not necessary to introduce any modifications to the CSS code to make the extra sections to work properly.

With that said, please take a look at the following code fragment. It constructs these brand new website sections, labeled “Services” and “Contact” respectively. Here they are:

<ul id="navbar">

<li><a href="#">Home</a>

<ul>

<li><a href="#">Menu item 1</a></li>

<li><a href="#">Menu item 2</a></li>

<li><a href="#">Menu item 3</a></li>

<li><a href="#">Menu item 4</a></li>

<li><a href="#">Menu item 5</a></li>

</ul>

</li>

<li><a href="#">About Us</a>

<ul>

<li><a href="#">Menu item 1</a></li>

<li><a href="#">Menu item 2</a></li>

<li><a href="#">Menu item 3</a></li>

<li><a href="#">Menu item 4</a></li>

<li><a href="#">Menu item 5</a></li>

</ul>

</li>

<li><a href="#">Products</a>

<ul>

<li><a href="#">Menu item 1</a></li>

<li><a href="#">Menu item 2</a></li>

<li><a href="#">Menu item 3</a></li>

<li><a href="#">Menu item 4</a></li>

<li><a href="#">Menu item 5</a></li>

</ul>

</li>

<li><a href="#">Services</a>

<ul>

<li><a href="#">Menu item 1</a></li>

<li><a href="#">Menu item 2</a></li>

<li><a href="#">Menu item 3</a></li>

<li><a href="#">Menu item 4</a></li>

<li><a href="#">Menu item 5</a></li>

</ul>

</li>

<li><a href="#">Contact</a>

<ul>

<li><a href="#">Menu item 1</a></li>

<li><a href="#">Menu item 2</a></li>

<li><a href="#">Menu item 3</a></li>

<li><a href="#">Menu item 4</a></li>

<li><a href="#">Menu item 5</a></li>

</ul>

</li>

</ul>

Done. Now, the menu looks much more functional, since a couple of extra sections has been added to it with just a few pieces of clean markup. Nonetheless, the best part of this enhancement process is that the additional sections don’t require modifying the previous CSS styles to function as expected. Isn’t that great? You bet it is!

Seeing is believing, so in the last segment I’ll show you the entire source code corresponding to the sample drop-down menu, this time including the sections we just added. In this way, you’ll be able to test it and customize it to suit your personal preferences.

Now read the section next section. We’re almost finished building this CSS-based menu!


blog comments powered by Disqus
STYLE SHEETS ARTICLES

- CSS Combinators: Working with Child Combinat...
- CSS Combinators: Using General Siblings
- Intro to CSS Combinators
- CSS Semicircles and Web Page Headers
- Drawing Circular Shapes with CSS3 and Border...
- More CSS Pagination Link Templates
- CSS Pagination Links
- Animated CSS3 Image Gallery: Advanced Transi...
- CSS3 Animated Image Gallery: Transitions
- CSS3 Properties: Fixed Heights with box-sizi...
- CSS3 Properties: Altering Strokes and 3D Eff...
- CSS3 Properties: Text-Stroke
- CSS3 Transitions: Width and Height Properties
- Creating a Drop Down Menu in CSS3
- Intro to CSS Transitions

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 10 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials