treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Centered Drop Down Menu Help

  • I'm having a heck of a time getting the desired effect out of a drop down menu. I would like this to be done with only css, and it has to be able to have menu items added and removed. What I'm hoping to get is a centered horizontal menu with drop downs (when needed). I get close but can't seem to make the drop down stay down when hovered over. It appears to be working with just the menu in Codepen, but in my page it breaks for some reason... I'm pulling my hair out and could really use some advice on this. Thanks much for any help!

    Here is a link to codepen: http://codepen.io/michaelgrindley/full/uxqce

  • put this in codepen.io

  • @grindleydesigns I see in Codepen that you're not using any kind of reset for the example. Are you using one in your project? Could the discrepancy be due to something in your reset cascading down?

  • (also don't forget Codepen gives you the option to link up your own external stylesheet if you need to)

  • Do you have a link to your page? It would be useful to check the code that is actually breaking...

  • What kgscott284 said. Your CodePen example works fine. Without access to the page that's breaking, it's not possible to say what the problem might be.