I’m working on a website for a small law office. In the side-menu, I’m trying to highlight the “current page”. I have tried changing the background of the LI, but this doesn’t quite do the trick; the list item doesn’t spread to the full width of the menu, so it looks bad.
Here’s a jsfiddle. I would like the yellow section to highlight like the pink section is highlighted: filling up the full vertical and horizontal space, not just highlighting the text.
Any suggestions on how to do this? I’ve included the style tag in the html just for example, obviously, and my real solution will be a little different when it’s done. But I can’t move forward until I figure out how to somehow highlight the entire line.
One little issue: you’re mixing
emandpxunits for layout. This makes it a lot harder when trying to make things line up.I’ve implemented it using a
.selectedclass that would be applied to the selected elements, and a special case for the elements which are sub-menu items:And a jsFiddle fork of your original with the changes: http://jsfiddle.net/CkKc7/2/.
Good luck.