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: 4 stars4 stars4 stars4 stars4 stars / 3
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

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

- Does HTML5 Need a Main Element?
- Revisiting the HTML5 vs. Native Debate
- HTML5: Not for Phone Apps?
- HTML5 or Native?
- Job Hunting? Freelancer.com Lists This Quart...
- HTML5 in the News
- Report: HTML5 Mobile Performance Lags
- The Top HTML5 Audio Players
- Top HTML5 Video Tutorials
- HTML5: Reasons to Learn and Use It
- More of the Top Tutorials for HTML5 Forms
- MobileAppWizard Releases HTML5 App Builder
- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




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