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
https://forums.phpfreaks.com/topic/250276-how-to-make-a-link-show-that-its-active/
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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.