Home arrow HTML arrow Page 5 - A Menu for All Browsers
HTML

A Menu for All Browsers


The aim of this series is to come up with code that can be used by all browsers without having code segments addressing the peculiarities of different browsers. I accomplished this in part in a previous series, but I needed to use extra code segments, and there were still some problems. This nine-part series addresses those problems while accommodating more browsers.

Author Info:
By: Chrysanthus Forcha
Rating: 3 stars3 stars3 stars3 stars3 stars / 2
May 06, 2009
TABLE OF CONTENTS:
  1. · A Menu for All Browsers
  2. · Tutorial arrangement of this series
  3. · The secret of the elaborated layout approach
  4. · Overall layout
  5. · The Main Menu

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
A Menu for All Browsers - The Main Menu
(Page 5 of 5 )

The main menu here does not have drop down buttons. I did not make any provision for that; I did not allocate any cell for that. There are five cells. Each cell has a link. Each cell and its content (link) is a main menu item. Clicking a link takes you to a page. Nothing happens when you click inside a cell but outside the link.

Each cell has an ID. The values are from D0 to D4. Each cell has an onmouseover event. When the mouse pointer goes over a cell a function, dropDownMenu(ID) is called. This function uses the ID of the cell to drop down the corresponding menu. In other words, this function uses the ID to change the value of the display property of the corresponding table from "none" to "block."

Note: the width of each cell of your main menu should be the same as the width of the corresponding drop down table. However, you can make the widths of these cells be different from one another. Give all of your tables and all of their cells the width they should have. If you do not do this, some browsers may not display your tables correctly.

In the example in this series, the main menu table has been given the following attribute:


border="1"


This means that all of the cells of this table have borders that are one pixel thick. The nature (color) of the border depends on the browser. From my experience, browsers generally choose appropriate colors. So I have not given any color to these borders.

We have done a lot for this part of the series. In the next part of the series I will explain the details of the layout. For the main table of the sub menus above, I have not mentioned the attributes of the tag. The attributes are important. I will explain that as we go along in the next part of the series.


DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

blog comments powered by Disqus
HTML ARTICLES

- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5
- BBC Adopts HTML 5, Mozilla Addresses Issues
- Advanced Sticky Footers in HTML and CSS
- HTML and CSS Sticky Footers
- Strategy Analytics Predicts HTML5 Phones to ...
- HTML5 Guidelines for Web Developers
- Learning HTML5 Game Programming
- More Engaging CSS3 and HTML Background Effec...
- Engaging HTML and CSS3 Background Effects
- More Web Columns with CSS3 and HTML
- Columns with CSS3 and HTML
- Creating Inline-Block HTML Elements with CSS
- Drag and Drop in HTML5: Parsing Local Files

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 2 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials