CSS Centered Page Causes Submenu Problems

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
cjs00c
Beginner
Beginner
Posts: 1
Joined: Fri Jun 10, 2005 10:04 pm

CSS Centered Page Causes Submenu Problems

Post by cjs00c »

I have set up a sample page for anyone to view what I am talking about.
http://www.acu.edu/~cjs00c/simple_menu_bug/home.html

I am using the latest version (5.7something). I have read on here that most people use tables to position the menu however I am trying to create a tableless layout using pure CSS.

The CSS declaration margin:auto; will center a div but the menu applies the margin to the submenu offset.

Any help would be appreciated.
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi,

You have your menu_data.js in a <div>. That usually causes positioning problems (you can find several examples of this in the help forum). These problems can be more pronounced in some browsers than in others. One thing you might try is to take an approach similar to placing the main menu in a table, as discussed here and here. In other words, try placing only the code for your main menu in the div (along with a call to drawMenus() ). You could do this in a separate .js file or put the code in an inline <script> block, within your html code. Then put the code for your menu styles and all of the the submenus into a separate .js file, which you do not load into the div. Don't know if that'll work, but it's worth a try.

Kevin
Post Reply