Jump to content

CSS "current" class


mrhello

Recommended Posts

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...