Home arrow HTML arrow HTML for a Common Browser Menu
HTML

HTML for a Common Browser Menu


In this part of the series I describe the HTML elements and their attributes. I do not talk about the events in this part; I will talk about the events in a later part. I will also talk about the CSS for the menu elements and sub menu elements. Throughout the series, we shall use the example that was described in the previous part.

Author Info:
By: Chrysanthus Forcha
Rating: 5 stars5 stars5 stars5 stars5 stars / 3
March 13, 2009
TABLE OF CONTENTS:
  1. · HTML for a Common Browser Menu
  2. · More on the Elements and Attributes
  3. · The Table Cell Contents in the DIV
  4. · The Style Sheet

print this article
SEARCH DEVARTICLES

HTML for a Common Browser Menu
(Page 1 of 4 )

The HTML Elements and their Attributes

The main menu is an HTML TABLE element. The table has one row with 10 table cells. Five cells are for the main links. Each link is in one of these five cells. Each of the other five cells is small. Each one follows a link cell and has a button. Each button corresponds to the preceding link. I will not talk about the onclick event now. This is the code for the one-row table:


<table cellpadding="0" cellspacing="0" border="0">

<tbody>

<tr>

<td class="link"><a href="mainlink0.htm">Main Link 0</a></td><td class="drop"><button type="button" class="drop" id="D0">v</button></td><td class="link"><a href="mainlink1.htm">Main Link 1</a></td><td class="drop"><button type="button" class="drop" id="D1">v</button></td><td class="link"><a href="mainlink2.htm">Main Link 2</a></td><td class="drop"><button type="button" class="drop" id="D2">v</button></td><td class="link"><a href="mainlink3.htm">Main Link 3</a></td><td class="drop"><button type="button" class="drop" id="D3">v</button></td><td class="link"><a href="mainlink4.htm">Main Link 4</a></td><td class="drop"><button type="button" class="drop" id="D4">v</button></td></tr>

</tbody>

</table>


For simplicity I have given the table a cellpadding of zero, a cellspacing of zero and a border of zero. Each drop-down button has an ID. The ID begins with the letter D for Drop Down followed by a number. The numbers are from 0 to 4 according to their positions.

All of the cells that have links are of the CSS class "link." Those that have the buttons are of the CSS class "drop." As you know, the CSS class is used to give the same style to all of the elements in the class (group).

Let us now talk about the DIV element that holds the sub menus. This is the code for the DIV element without the cell contents:


<div id="D1" style="position:absolute; width:900px; z-index:10; display:block; background:transparent; border-width:0px; padding:0px; margin:0px">

<table cellpadding="0" cellspacing="0" border="0" id="TSM">

<tbody>

<tr><td class="sub"></td><td class="sub"></td><td class="sub"></td><td class="sub"></td><td class="sub"></td></tr>

<tr><td class="sub"></td><td class="sub"></td><td class="sub"></td><td class="sub"></td><td class="sub"></td></tr>

<tr><td class="sub"></td><td class="sub"></td><td class="sub"></td><td class="sub"></td><td class="sub"></td></tr>

<tr><td class="sub"></td><td class="sub"></td><td class="sub"></td><td class="sub"></td><td class="sub"></td></tr>

<tr><td class="sub"></td><td class="sub"></td><td class="sub"></td><td class="sub"></td><td class="sub"></td></tr>

</tbody>

</table>

</div>



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-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials