We help IT Professionals succeed at work.
Get Started

fly-out menus, want some items not linked to have hover state not appear

Brad Bansner
Brad Bansner asked
Last Modified: 2012-08-13
On this page:


Relevant CSS is attached. Someone else built this website, I am being asked to make a change, and I am stuck. I think what I want to do is relatively simple, there are two places in the menus on the left where it says:

<a href="#">Mechanical Services:</a>

In those cases, I don't want the background (hover) state to appear. I got around the linking by making it "#" obviously, but client wants the hover state removed. But if I remove the <a> tags around it, then the style is completely broken. I'm hoping someone a little better with writing CSS can show me how to do this? Thank you!
li.mainlinks {
		position: relative;
		display: block;
		font-family: Helvetica, Arial, sans-serif;
		font-size: 11px;
		line-height: 21px;
		color: #000000;
		margin: 0px;
		padding: 0px;
li.mainlinks:hover span.mainlinksfly {
		display: inline;
span.mainlinksfly {
		position: absolute;
		z-index: 3;
		top: 1px;
		left: 230px;
		width: 200px;
		display: none;
		font-family: Helvetica, Arial, sans-serif;
		font-size: 11px;
		line-height: 13px;
span.mainlinksfly a {
		padding-bottom: 4px;
		background-color: #e7eeda;
		padding-left: 8px;
		padding-right: 0px;
		display: block;
		padding-top: 4px;
		z-index: 1000;
		position: relative;
span.mainlinksfly a:hover {
		background-color: #d5e2c0;
		z-index: 1000;
		position: relative;

Open in new window

Watch Question
Top Expert 2011
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE