Rounded list item on hover

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • KeredDrahcir
    Contributor
    • Nov 2009
    • 426

    Rounded list item on hover

    I'm using an unordered list as a navigation menu. The Main Menu needs to have rounded edges on the last item only. I can achieve that using the border-radius property on the ul tag and made the background colour of li tags transparent. I've run into a problem now that I need to specify a hover colour.

    If I give the colour to the li item, the last item appears square and if I give the border radius to the hover property then all the others have a rounded bottom. Is there any way to give a rounded border for only the last list item?
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    you could use the CSS pseudo class :last-child (where supported) or just give the last item a class and tie the rounded corner to that class.

    Comment

    • KeredDrahcir
      Contributor
      • Nov 2009
      • 426

      #3
      I can't access the HTML so I'll have to try your first suggestion.
      Do you know which browsers don't support it? I usually test in IE 6, 7 & 8, Firefox, Safari, Google Chrome and Opera.

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        according to quirksmode, every major browser except IE (< IE9)

        Comment

        • KeredDrahcir
          Contributor
          • Nov 2009
          • 426

          #5
          What a surprise (sarcasm). That shouldn't be a major problem.

          It works like a charm in Firefox. Many thanks.

          Comment

          Working...