HTML
  Home arrow HTML arrow Quick Web Page Menu
Iron Speed
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  
Dedicated Servers  
Download TestComplete 
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? 
HTML

Quick Web Page Menu
By: Chrysanthus Forcha
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 5
    2008-04-30

    Table of Contents:
  • Quick Web Page Menu
  • Strategy
  • Code continued
  • Explanation of Code

  • 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

    Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!

    Quick Web Page Menu
    (Page 1 of 4 )

    Many applications (e.g. Microsoft Word) have a menu as their first bar. If you have a web site that has many pages, you can create a similar menu bar where, if you click a menu item, a drop-down menu with links will appear over other content on the page. You might have seen this on some web pages already. Keep reading if you would like to learn how to build this for your web site.

    Introduction

    In this article, I show you how you can design such a menu when you are in a hurry. You can also take this as a basis to design a menu for commercial purposes. To understand this article, you should have basic knowledge of HTML, Cascading Style Sheets and JavaScript.

    Preliminaries

    We need to be aware of certain things before we continue to the analysis. The first item we need to know is how positioning in HTML works.

    There is a CSS property called the Position property. It is used to position an HTML element anywhere on a web page. This property can take the value "absolute;" it can also take the value "relative." So if you want to position a DIV element for example, on a web page you can begin the syntax for the DIV element in your CSS like this:


    div {position:absolute ...


    or


    div {position:relative ...


    The value of "absolute" positions the element on the web page by taking the top-left corner of the client area of the web page as the origin, with coordinates (0px, 0px). When you use absolute positioning, the element (DIV in this example) will not occupy any space that another element would have taken, with the normal flow as you place elements as content of the BODY tag. This means that if you place another element normally, it may lie behind or in front of the element with the absolute position property.

    The value of "relative" does not change the position of the element in the normal flow as you place it, as content of the BODY tag. The element occupies space in the area where you place it as content of the BODY tag.

    The CSS z-index Property

    The CSS z-index property sets the stack order of an element. An element with a larger stack order is always in front of another element with lower stack order. In simple terms, the z-index property allows an element to be placed in front or behind another element as seen by the viewer of the web page. The z-index is a number and an element with the greater number appears in front of an element with the smaller number.

    Note: the z-index property only works on elements that have the position property.

    If you create an element and give it the absolute position property (position:absolute), but do not give it the Left and Top property, the element should remain where you placed it in the normal flow as content of the BODY tag. It will still not occupy space. It will still be able to lie in front or behind elements that occupy space and take their position normally in the normal flow.

    More HTML Articles
    More By Chrysanthus Forcha


       · If you are looking for an approach to creating web page menus that is independent of...
     

    HTML ARTICLES

    - Text on HTML Images: Do it Yourself
    - Custom Buttons in HTML
    - Quick Web Page Menu
    - Maximizing and Restoring HTML Images with th...
    - Maximizing and Restoring HTML Images with th...
    - Handling Hyperlinks and Images in HTML
    - Quick Start with HTML
    - HTML Tips
    - Color Composition and HTML
    - HTML Fonts, Styles, and Headers
    - Uses of the New Window Command for Web Sites
    - HTML Working with Images
    - HTML: Working with Special Characters
    - HTML Forms
    - HTML Tables


     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway