Solved

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

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

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 4

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 4

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
The viewer will learn how to dynamically set the form action using jQuery.
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…

705 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

17 Experts available now in Live!

Get 1:1 Help Now