Jump to content

How to make a link show that it's active


cerberus478

Recommended Posts

I would like to know how to make my links show that it's active. For example if I click on a link that says overview then that link has to be highlighted.

 

This is the code that I have:

 

<?php 
					if (isset($this->_params['submenus']) && is_array($this->_params['submenus'])){
						foreach ($this->_params['submenus'] as $submenu){
					?>
						<li class="active"><a href="<?php echo $this->get_uri("/{$submenu['controller']}/{$submenu['action']}") ?>" onclick="javascript:return setSubMenu(<?php echo $submenu['id'] ?>);"><?php echo strtoupper($submenu['name'])?></a></li>
					<?php
						}
					}
					?>

 

Unfortunately with this code all the links are selected as active.

Link to comment
Share on other sites

Do you mean active - as in a tag css code? If so  then you need to do this in style sheet part at the top of your page.

Or do you want to highlight the link to show it is 'active'? In which case you still need to change the style

 

in the css, a tags have several pseudo codes which affect them, maybe it is these you are trying to change?

Or you can change the style dynamically with javascript if you want.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.