WordPress.org

Forums

[resolved] Nav menu - make background click able? (10 posts)

  1. skallerup
    Member
    Posted 2 years ago #

    I'm having a menu with some background images - how can I change the code, so I can make the images(background) click able?

    My site: http://www.martinskallerup.dk/skovbo

  2. esmi
    Forum Moderator
    Posted 2 years ago #

    Using CSS, make the text links block level elements using display:inline-block; and adjust their height & width. Then turn your images into backgrounds for these links.

  3. skallerup
    Member
    Posted 2 years ago #

    I've now changed the display til inline-block, but the images are already backgrounds?

    So what do I need to adjust of height and width?

    And thank you for the fast reply!

  4. esmi
    Forum Moderator
    Posted 2 years ago #

    The images are currently the background images on the <li> tags - not on the links themselves.

  5. skallerup
    Member
    Posted 2 years ago #

    How can I add a background to a link, when they dont have a id or class?

  6. Andrew
    Forum moderator & snail smusher
    Posted 2 years ago #

    You just want to add background to 1 link?

  7. skallerup
    Member
    Posted 2 years ago #

    all the menu icons I have now, I need them to able to click on.

  8. Andrew
    Forum moderator & snail smusher
    Posted 2 years ago #

    Instead of adding padding-top to the <li>s of the menu, why not just add padding-top to the <a>s of the menu?

  9. esmi
    Forum Moderator
    Posted 2 years ago #

    Uh? Do you know how to use CSS selectors like #menu-item-34 > a?

  10. skallerup
    Member
    Posted 2 years ago #

    I removed the padding-top at
    <li> and added padding-top to <a> instead.

    Looks like its working, so thank you both very much - very appreciated :)

Topic Closed

This topic has been closed to new replies.

About this Topic