I’m looking to solve quite a buggy issue I have with a menu. I’ve tagged this with jQuery, too – I’m thinking it can solve the issue faster.
I have a drop-down menu, made in CSS, with inner children. Unfortunately, I don’t know how many children links each parent may have and each of it left floated and block. I can’t edit the CSS each time there’s a new link added to add margin-left.
jsFiddle with the menu: http://jsfiddle.net/guBwZ/1/
What I’m after: I’m trying to display the inner links of Link #2 (also Link #3) right below the Link #2, somehow centered (see below jsFiddle).
jsFiddle with what I’m after: http://jsfiddle.net/6meU8/ (hover on Link #2 and Link #3).
Any help is highly appreciated.
Thank you.
UPATE:
Based on @craniumonempty example, I’ve updated the below jsFiddle with what I was looking for: http://jsfiddle.net/guBwZ/32/
Basically, I’ve moved from display:none to visibility:hidden to measure the width of inner UL and then move it inside the div.center.
Thank you!
first remove the div with the center. I’m not sure it’s even in a place it’s supposed to be either way.
Next: put “position:relative;” for “#menu ul li” that will line them up.
Then: remove height and width for “#menu ul li.sub-menu ul”
http://jsfiddle.net/guBwZ/12/
Is that kind of what you are looking for?
Also, if you want examples of multilevel working css menus:
http://ago.tanfa.co.uk/css/examples/menu/hs7.html
EDIT: ok, had to leave for a bit. Not sure where you are currently, but here is what I’ve got:
http://jsfiddle.net/guBwZ/14/
Not the best code in the world but works. Here is the jquery:
html:
and css: