Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Help needed with drop down menu

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #40002
    Derper
    Member

    Hi! I’m building a drop down menu for my project.
    The problem is that _ul_ elements with absolute positioning which shows on :hover are not centered under parent _li_ elements as they should be.

    I’ve tried to add “left”/”right” to css but with no luck.
    Codepen: http://codepen.io/anon/pen/tkfJH

    I’ll be glad if anyone can help. Thanks.

    #110744
    Paulie_D
    Member

    I’m not sure what you are after.

    If you want to center the list items under the parent EVEN THOUGH they are wider…I don’t think you can do that.

    #110745
    Derper
    Member

    So the problem is width, ok. How to make parent element remain width: auto, and not loose “vertical rectangle” form of the items that shows on hover?

    If I set width: auto; to them, they are not displayed correctly. – http://codepen.io/anon/pen/tkfJH

    #110746
    Paulie_D
    Member

    You might want to put widths on the ‘a’ links rather than the list items.

    http://codepen.io/Paulie-D/pen/dgqal

    I’m still having trouble trying to figure out what it is supposed to look like. Do you have a mock-up image?

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.