473,326 Members | 2,108 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

CSS problem with IE

56
I modified some code from the suckerfish site for CSS dropdown menus. Works fine in Safari and Firefox (Mac and PC). But in IE (PC), one test version of the code works but the other doesn't. Here are the links where you can view the pages and see the source code if you want:

live (no work in IE)

test (works everywhere)

I've gone over the code and can't see why the live one shouldn't work in IE when the test one does. The styles (other than colors) are identical.

Help please?
Mar 8 '06 #1
11 3614
webhead
56
I don't get it.

I made another test page and put the style sheet in with the main page and cut out all the graphics. Still didn't work. Took out one thing at a time till I found out where the problem was.

There are 2 sets of nav links, the top and the left bar. If I remove the left bar it works. It's a UL with LIs just like the other one, only I gave the UL a different ID. There's some kind of conflict going on there, but any ideas would still be appreciated. Gonna go fix the live page now.
Mar 8 '06 #2
Banfa
9,065 Expert Mod 8TB
I can see a couple of things that are wrong
  1. There is more than 1 element with the id "nav". Id's on a web page are supposed to be unique and behaviour if they are not is undefined.
  2. Similarly there is more than 1 element with the id "vnav"
  3. There is an error in the DOCTYPE, the is a space missing between the 2 quoted parts (look for "" and put a space between them)

Your description of the problem "it doesn't work" is not good enough. Doesn't work in what way? you don't see the menus, they appear with the wrong styles. Hard to suggest a fix to a problem when you don't know what it is (although posting the URLs was a good idea, I just couldn't what was desired and undesired behaviour).


However if you want to author web-pages that have good cross browser support then you need to write Valid HTML pages. You can validate you HTML on line at the W3Cs site http://validator.w3.org/. Currently (if I correct the DOCTYPE) your page has 60+ errors and warnings.
Mar 8 '06 #3
webhead
56
Hi, thanks for responding.

I've validated some HTML and CSS before but not on this web. But this menu problem is partly caused by my not knowing CSS that well yet, and just copying and pasting code from a tutorial. I wondered about the multiple IDs but that's what the tutorial did, so I just copied it. I assume I could do the same thing with classes then? Or I would use ID for the nav bar since there's only one that does dropdowns?

Sorry about the vagueness. What didn't work was in IE the menus wouldn't drop at all, like it didn't recognize the rollover. The DOCTYPE error came from my editor; I never pay much attention to it. (using Taco, a freebie for the Mac). I'll clean that up and see if I can convert the multiple IDs to classes.

Thanks again!
Mar 9 '06 #4
webhead
56
Well, other than the 5 errors caused by the & in PHPSESSION, the html is cleaned up. Now I'm back to the original situation: the menus (Favorites and Articles) won't drop down in IE.
Mar 9 '06 #5
Banfa
9,065 Expert Mod 8TB
OK I see the problem now, strangely last night at home they were working on IE for me.

Right so you have the HTML valid, however there are still several logic errors in your code which unfortunately are not going to easy to explain, and will take a while for me to sort out. I will come back to this at lunch time (cos now I have to work) and try to explain some of the problems.
Mar 9 '06 #6
webhead
56
Thanks, any help is appreciated. CSS tutorials and what people do in the real world don't seem to match, which is very confusing.

Also, in the mean time I might put up some temporary links till the menus are fixed.
Mar 9 '06 #7
Banfa
9,065 Expert Mod 8TB
OK where to start ...

In order to avoid having multiple ids with the same value you have changed them all to classes. Now if you were only using CSS this would be fine, unfortunately you are using javascript as well and using getElementById to try and get references to the elements of your menu bar.

The basic method you are using to display your menu are OK, that is having a undisplayed list of sub-menu items that is displayed when you rollover the main menu item.

The reason that it works in Firefox/Mozilla is that for these browsers the menu is handled entirely by the CSS but Explorer needs the help of Javscript which isn't working because there are no ids the Javascript can't locate the top of the menu.

What I have done is uploaded a fixed (and simplified) example to http://www.puttingdownroots.me.uk/~examples/menu.html. The changes I have made are
  1. Added an id (HMenu) to the top level of the menu so it can be located easily.
  2. Altered the Javascript to use this id to get the starting point in startList.
  3. Made some minor alterations to the CSS, removed a:over because it's not valid
Mar 9 '06 #8
Banfa
9,065 Expert Mod 8TB
BTW looking at you CSS file it looks to me like it could do with tidying up, I'm not convinced that all the rules there actually relate to elements that exist.

I may be wrong though that is just my impression I didn't go through with a fine tooth comb and check everything.
Mar 9 '06 #9
webhead
56
OK where to start ...

In order to avoid having multiple ids with the same value you have changed them all to classes. Now if you were only using CSS this would be fine, unfortunately you are using javascript as well and using getElementById to try and get references to the elements of your menu bar.

The basic method you are using to display your menu are OK, that is having a undisplayed list of sub-menu items that is displayed when you rollover the main menu item.

The reason that it works in Firefox/Mozilla is that for these browsers the menu is handled entirely by the CSS but Explorer needs the help of Javscript which isn't working because there are no ids the Javascript can't locate the top of the menu.

What I have done is uploaded a fixed (and simplified) example to http://www.puttingdownroots.me.uk/~examples/menu.html. The changes I have made are
  1. Added an id (HMenu) to the top level of the menu so it can be located easily.
  2. Altered the Javascript to use this id to get the starting point in startList.
  3. Made some minor alterations to the CSS, removed a:over because it's not valid
Thank you! All is working now. Yeah, I'm sure the CSS needs cleaned up, but I still have a lot to learn about that. So far it just looks like the world would be a better place if only IE played by the rules. :)
Mar 9 '06 #10
Banfa
9,065 Expert Mod 8TB
So far it just looks like the world would be a better place if only IE played by the rules. :)
LOL Oh you are so right :rolleyes: MS are just terrible generally most of the excptions you will need to make will be for IE.
Mar 9 '06 #11
webhead
56
Note:

Occasionally I see someone visit my site from the link here. I've since changed the layout significantly, so the suckerfish menus are not being used anymore. Sorry for the wild goose chase.
Jul 18 '06 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Madhusudan Singh | last post by:
Hi After months of waiting for Redhat to come out with up to date rpms, I decided to compile a working OpenSSL/ MySQL / PHP / httpd installation for myself. Installed the latest versions of...
0
by: Alexander Skwar | last post by:
Hello! I'm having problems getting PHP 4.3.3RC4 successfully to install on my HP-UX 11.00 server. After a (successfull?) compile, "make install" errors out with this error message: ...
7
by: Darren Gamble | last post by:
Good day, I've sent a message on this to the php-general list already, but unfortunately no one replied. Sorry for the repost. to those that read both... I'm having a problem working with an...
7
by: kecebong | last post by:
I tried to compile php 4.3.3 with gd but it doesn't work, it wasnt show in phpinfo(). My system is redhat 9 and apache 2.0.47 webserver.
0
by: Slavik | last post by:
All libraries were installed (precompiled) This is FreeBSD 5.1 installed zlib, installed jpeg and png libraries (in default directories) GD 2.0.11 source is in /usr/gd-2.0.11 (compiled and...
3
by: Garrett Albright | last post by:
Trying to compile PHP 5 beta 4, and not having much fun... % ./configure --with-apxs --with-mod_charset --with-zlib --with-bz2 --with-curl --with-gd --with-mhash --with-pspell...
0
by: LRW | last post by:
(Not even sure if that's the right way to word the question.) We're trying to migrate to a new server, and upgrade the PHP on the new server in the process. We're using a RedHat Enterprise Server...
9
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my...
3
by: Ron King | last post by:
When I installed Mandrake 10.0 I thought I had Apache, PHP, and MySQL installed correctly. I could serve web pages, MySQL worked, and when I tried the phpinfo() function, I got a page that looked...
13
by: Gary Quiring | last post by:
I need to create an XML string using PHP5. The examples I have followed seem to be using out dated libary calls. I tried new_xmldoc() and new DomDocument. Both get undefined errors. How do I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.