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 / 1
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

TOOLS YOU CAN USE

advertisement
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

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