Solved

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

Posted on 2015-01-19
4
187 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

863 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now