Almost a dropdown


I am trying to code up a design which was provided to me by an art director I am working with. She wants a menu where the items with submenus trigger a dropdown which appears shifted up. I tried adjusting a basic css dropdown just setting a negative top margin on the menu item, which works until you move your cursor off of it, which makes the whole submenu move back down again. The ‘pop up’ submenu would have to stay in the mouseover position until the cursor is moved from it, and needs to have a different background color for rollovers.

Here is a link to a screenshot of what I am trying to accomplish.

Here is what I have so far in codepen: Feel free to tinker with it.

Any assistance would be GREATLY appreciated!



Your first link gives me this warning message form Mcaffee!

Warning: Suspicious Site
Are you sure you want to go there? may be risky to visit.

Why were you redirected to this page?

When we visited this site, we found it exhibited one or more risky behaviors.

So as I couldn’t see the screenshot it might be better if you just attach the screenshot to this thread.

To adjust where a submenu appears you would adjust the top position of the nested ul and not the list item.


#cssmenu li ul{

Or if you have a stacking context (position:relative on the main parent) then you could use “top” instead)

Hi Paul,

The attachment is harmless, I don’t know why McAffee would flag it as suspicious.

Thanks Pullo.:slight_smile: Mcaffee occasionally seems to flag up a few ‘false positives’ but it was only the orange warning and not the red. There’s probably something it doesn’t like.

Adjusting the top position of the menu should do as you want.

#cssmenu li ul{
[B]  margin-top:-5em;
  padding:2em 0;[/B]