HTML
  Home arrow HTML arrow Quick Web Page Menu
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? 
HTML

Quick Web Page Menu
By: Chrysanthus Forcha
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 7
    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


    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

    - Concluding a Menu for All Browsers
    - A Vertical Menu for All Browsers
    - Downloading Long HTML Pages with ACP
    - Background Images for a Menu for All Browsers
    - React and ToChoose Functions for a Menu for ...
    - Fast FAQ Session with ACP
    - Functions for a Menu for All Browsers
    - Browser Compatibility Modifications for a We...
    - Building a Drop-Down Menu with Nested HTML L...
    - Table Attributes for a Menu for all Browsers
    - Modifying a Web Page Calendar
    - Styling Elements of Nested HTML Lists
    - Configuring Tables for a Menu for All Browse...
    - Showing a Full Year with a Web Page Calendar
    - Designing with Nested HTML Lists







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
    Stay green...Green IT