WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] select first and last element in menu (4 posts)

  1. adjustreality
    Member
    Posted 3 years ago #

    normally I would ID first and last item in a list to do something like this:

    http://localhostr.com/files/44Ad3kh/Picture+4.jpg

    but I'm not entirely sure how to do this with wordpress since menu is dynamic. any ideas?

  2. Connor Montgomery
    Member
    Posted 3 years ago #

    What exactly are you looking to do? Depending on that, we can offer different methods.

    Best,
    Connor

  3. adjustreality
    Member
    Posted 3 years ago #

    well I need to just make that menu, basically. however that is.

    normally I would use something like http://selectivizr.com/ to select first and last element and assign images to it to round the corners. I don't want to use CSS3 to round the corners since's not supported by all browsers.

    problem is that wordpress is dynamic, and menu's change so I want it not to break if they add a new section of the site.

  4. Connor Montgomery
    Member
    Posted 3 years ago #

    A little bit less-semantic way to do this is like so:

    <div id="nav-wrapper">
          <div id="nav-left">
                 /* Left corner image here */
           </div>
           <div id="nav-center">
                /* Dynamic nav here */
            </div>
            <div id="nav-right">
                /* Right corner image here */
             </div>
    </div>

    And then, you'd make the nav-left and nav-right a display:block; float:left (or right, for nav-right), give them a width, and backround-images. Then, just give the nav-wrapper a width in px, and that should work perfectly well. Also be sure to give the #nav-center a background that repeats-x (or is just a hex), then that'll work like the sliding door effect. That way, you don't need to target the first element, although I'm sure that's possible, am just in the middle of doing some homework right now ;)

    Best,
    Connor
    @c_t_montgomery

Topic Closed

This topic has been closed to new replies.

About this Topic