Solved

CSS Newb Question - Even Width for Menu Tab's background Hover

Posted on 2015-01-19
4
196 Views
Last Modified: 2015-01-20
I'm trying to get my menu background's hover to have an even width, or at least so the menu tab's hover background's are flush with each other.

Right now when you hover over the menu tabs there's a gap between them.

I've tried playing with the menu's li ul padding and margins to extend this however I can't seem to figure out how to control the gap. The background hover is also bleeding too high vertically.

Just trying to figure out what class/rule can control this.

Any help appreciated.

Example PSD of what I'm trying to achieve is attached.

Website URL: http://7pwc.moshpitdigital.com
Screen-Shot-2015-01-19-at-2.11.25-PM.png
0
Comment
Question by:doug s
  • 3
4 Comments
 
LVL 3

Expert Comment

by:Morgan Finley
ID: 40558904
My guess on this one is to remove the extra padding from the right of the list items, which is currently set to padding-right: 30px; and then add 15px of padding to each side of the link within the list items.

#nav ul li {
padding-right: 0;
}
#nav > ul > li > a {
padding: 0 27px 0 27px;
}

Open in new window

0
 
LVL 3

Expert Comment

by:Morgan Finley
ID: 40559036
After digging some more, I see what you're talking about. I've got the items to display wider, but there's still a small gap, which I can only see when I hover next to a "current" menu item.

Still digging here...
0
 
LVL 3

Accepted Solution

by:
Morgan Finley earned 500 total points
ID: 40559055
I think something is going on with how the drop-down is positioned, but strangely I can't find any positioning properties going on, nor margins and padding. I think you might just have to take the dirty solution of negative margins. Give this a try:

#nav ul li {
padding-right: 0;
margin: 0 -3px;
}
#nav > ul > li > a {
padding: 0 27px 0 27px;
}

Open in new window

0
 
LVL 4

Author Comment

by:doug s
ID: 40561037
Thanks Morgan this will get me started.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question