Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Ok ,i am not a great fan of the menu of WP, but now it manage this inside pretty ok, i have to make theme that use that menu. Now for styling i am a bit challenge...

here is the problem... the menu should look like

| page1 | page2 | page 3 |

Do you see the problem, the border, let say each

  • will be style with border right 1px that work but first item will need a special class for border left

    Question. How do i know that it's first or last item in the menu to style it properly... or what is your way to style that type of menu...

  • share|improve this question
        
    Look like a thing for jquery –  menardmam Mar 26 '11 at 23:10

    1 Answer 1

    up vote 0 down vote accepted

    Are you using CSS3?

    You could use:

    ul#navmenuid:first-child {
         border-left: 1px;
    }
    

    Or you could use (any LI that immediately follows an LI):

    ul#navmenuid li {
         border-left: 1px;
         border-right: 1px;
    }
    ul#navmenuid li + li {
         border-left: 0;
    }
    

    Or you could use (any LI that follow an LI, even if not immediately):

    ul#navmenuid li {
         border-left: 1px;
         border-right: 1px;
    }
    ul#navmenuid li ~ li {
         border-left: 0;
    }
    

    Lots of options via CSS, really...

    share|improve this answer
        
    it's not really ie6 friendly ? –  menardmam Mar 26 '11 at 14:36
        
    Same way you can use JQUERY! –  Bainternet Mar 26 '11 at 20:51
        
    I stopped caring about IE6 friendliness years ago. At most, I will use IE conditionals to add some margin fixes to correct IE's inconsistent box model, but that's it. –  Chip Bennett Mar 28 '11 at 17:37

    Your Answer

     
    discard

    By posting your answer, you agree to the privacy policy and terms of service.

    Not the answer you're looking for? Browse other questions tagged or ask your own question.