ID to Class: loss of formatting?

admin

Administrator
Staff member
I was tooling around with a Dropdown menu, where when you clicked on a button, there would appear below it a submenu. It was working all nice and peachy for the first submenu, but at the moment (pretty late last night) I was thinking on how I could have multiple submenus without duplicating the code and just changing the ID. 'Cause I needed the ID for the dropdown function to work. So, today, when I was a bit more clear-headed, I realized I could just change the ID to a class, and apply a ID to the submenu that did nothing except allow me to target it with my dropdown script. WOO! Lol, anyhoo, when I made the required changes, I lost a bit of formatting. I had specified a width for the submenus, as to have them indent, yet not have them run past the sides of their parent links. But after changing the ID's to classes, I lost that width. They are now as wide as their parent links.

I'm not exactly sure what the problem is. I was thinking maybe it was the nesting of the lists and the way I have written out the CSS. I.e., not properly referencing the nested list.

Blah. Anyhoo, said menu can be found at this location. (<!-- m --><a class="postlink" href="http://pauljunior.no-ip.com/research/menu.php">http://pauljunior.no-ip.com/research/menu.php</a><!-- m -->)Aahh, I need to think more before I post here. :p
I have solved my problem.
The CSS for the submenus was as follows:

ul.sub li a:active {
...........................
}

Changed that to:

ul#nav ul.sub a:active {
...................................
}

And that fixed it. :D I just had to place the ul#nav in there, which is the parent menu, as to ensure I was styling that particular list (the submenu).

P.S., Solved problem a few minutes after posting, but I was not able to delete my post, otherwise I would have done so. :(I've done that.. hence the need for the infamous "edit" button...
 
Back
Top