Jump to content

Recommended Posts

Posted (edited)

I have a nav menu using UL, LI and images.

 

I have the inactive and the active working fine, but I just can't get the current working.

As the link text is actually in the image itself, I have a specific class name for each image/link.

/* inactive state */

#main_nav li a.home{

background:url(home_img.png);

}

#main_nav li a.about{

background:url(about_img.png);

}

 

/* hover state */

#main_nav li:hover a.home{

background:url(home_hover.png);

}

#main_nav li:hover a.about{

background:url(about_hover.png);

}

 

What I want is the current class to be assigned to the same as the hover. This is normally easy when each image is the same, but as all my images have the link text in them, I need to assign the "current" class to each specific class.

 

eg

class="home"

OR

class="home current"

I have that working fine in the PHP, I just cannot get the CSS tied to the "current" with each specific class.

Edited by mrhello

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...