...

View Full Version : Javscript Menu and CSS



whizard
01-21-2005, 11:09 PM
This line of code:

<link href="[path to css file here]" type="text/css" rel="stylesheet">

is causing a JS/DHTML nav menu to load incorrectly. The menu is about 3 times as wide as I specified in my config file, and the background colors are all white.

I was wondering if anyone knew why the CSS link is throwing off my code.

Sincerely,

Dan Barr

kwhubby
01-21-2005, 11:42 PM
Well If you could show an actual example of this it would be very helpful because if used correctly that line of code should cause no problems. The style sheet that is linking to or improper use of that tag could cause a problem like this. The tag itself should be in the head of the document (<head> </head>) and should be before the body tag etc etc. Anyways an example is needed.

One note, this thread really should be in html/css forum as this has nothing to do with javascript but rather html/css.

whizard
01-22-2005, 12:01 AM
Sorry. I was still working on the example.

Here it is:

http://www.robowhizards.com/examples

Now when I put it on the web, it has JS Error, 'menus' are undefined

Dan

This should probably go in dynamic drive area, as this is a DD script...

caio
01-22-2005, 09:52 AM
There are no Javascript ERRORS in this example.

The link to the external "main.css" is just screwing up the layout since the content of "main.css" overrides the definition of all the table/tr/td TAGS in the HTML, including the Javascript dynamically generated menu which are tables/tr/td themselves.

If you change the first "table" in "main.css" to be ".mytable" and then assign the class ".mytable" to the table in your HTML this will make you understand better what I mean.

Use class names in your HTML and CSS files instead of referring to global TAGS. For more info visit the CSS/HTML forum.

Caio



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum