HTML
  Home arrow HTML arrow Page 2 - HTML for a Common Browser 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

HTML for a Common Browser Menu
By: Chrysanthus Forcha
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2009-03-13

    Table of Contents:
  • HTML for a Common Browser Menu
  • More on the Elements and Attributes
  • The Table Cell Contents in the DIV
  • The Style Sheet

  • 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


    HTML for a Common Browser Menu - More on the Elements and Attributes


    (Page 2 of 4 )

    The DIV element has an ID and the style attribute. We shall talk about the use of the ID later. The first property in the style attribute is the position property. The value of the position property is "absolute." When you give the "absolute" value to the position property of an element and you do not give the element the CSS left and top properties, the element will remain in the position of the normal flow.

    However, under this condition, the element will appear in front the other elements in the normal flow, beginning from the position where it was put. An element will appear in front of another depending on the z-indices of the two elements. The one with the higher z-index appears in front. The BODY element behaves as if it has a z-index of zero. Elements in the normal flow behave as if they have a z-index of 1. So I gave the DIV element a z-index of 10 to make sure it appears in front of the elements around it. It would hardly ever happen that any element in your web page would have a z-index of up to 10.

    The background of the DIV is transparent. The value of the display property is "block." Since the z-index value is 10, the DIV appears in front of all the elements behind it. When any sub menu item has to be displayed, the background of its cell is given a color. So you do not see through the DIV where table cells have background color, but you see through the DIV where there is no cell background color. For simplicity and compatibility between browsers, the border-width of the DIV is zero, the padding is zero and the margin is zero. Note that different browsers may have different default values for these three properties.

    The table inside the DIV element has a cellpadding of zero, a cellspacing of zero and border of zero. The widths of the columns of the table in the DIV are the same as the widths of the columns of the table in the main menu. This is done by CSS.

    With all these specifications, the corresponding columns between the table in the main menu and the table in the DIV are aligned. So when you click the Drop Down button, the sub vertical menu you see appears directly below the corresponding link in the main menu.

    Do not forget to give a width (value) for the DIV element; otherwise the code will not work with the three browsers that I have mentioned.

    More HTML Articles
    More By Chrysanthus Forcha


     

    HTML ARTICLES

    - Hello HTML 5, Goodbye Gears
    - Comparing Browser Response to Active Client ...
    - Testing Browser Response to Active Client Pa...
    - Active Client Pages: Completing the Code for...
    - ACP and Browsers: Setting up an Example
    - How Browsers Respond to Active Client Pages
    - Completing a Tree with Active Client Pages
    - HTML Form Verification and ACP
    - Building an ACP Tree
    - Completing an ACP 3D HTML Table Image Gallery
    - Building an ACP 3D HTML Table Image Gallery
    - A Multiple Page Image Gallery with Active Cl...
    - Building an Image Gallery with Active Client...
    - Concluding a Menu for All Browsers
    - A Vertical Menu for All Browsers







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