This is a discussion on Tabs menu in php/css within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hi everyone, I am trying to put a tabs menu on my php site. My goal is having a link ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi everyone, I am trying to put a tabs menu on my php site. My goal is
having a link change color when clicked, and staying that way until the user stays in the section of the site it links to. I was thinking about using CSS and the A:active tag, but the link changes color only while clicking on it, and then goes back to it's default color when the linked section is open. Can anyone help me? I am sure there is a php command for this, or a right way to do it in CSS. |
|
|||
|
What about using the code
list($temp, $rootdir) = split('[/]', $_SERVER['PHP_SELF']); if ($rootdir == 'news' ) { <a href='link' class='selected'>Link</a> } else { <a href='link' class='unselected'>Link</a> } And then you'll need to define in your CSS the unselected for both a:visited and normal a Hope that helps, obviously you would need to repeat that code for each of your links. Its what I've done with the menu system on my site. "Zink" <joman@zibi.com> wrote in message news:AUl_c.14212$G36.7158@tornado.fastwebnet.it... > Hi everyone, I am trying to put a tabs menu on my php site. My goal is > having a link change color when clicked, and staying that way until the user > stays in the section of the site it links to. > I was thinking about using CSS and the A:active tag, but the link changes > color only while clicking on it, and then goes back to it's default color > when the linked section is open. > Can anyone help me? I am sure there is a php command for this, or a right > way to do it in CSS. > > |
|
|||
|
Zink wrote:
> Hi everyone, I am trying to put a tabs menu on my php site. My goal is > having a link change color when clicked, and staying that way until the user > stays in the section of the site it links to. > I was thinking about using CSS and the A:active tag, but the link changes > color only while clicking on it, and then goes back to it's default color > when the linked section is open. > Can anyone help me? I am sure there is a php command for this, or a right > way to do it in CSS. IIRC the order of the link status is important in the css - try setting the order to: a:link a:visted a:hover a:active Regards, Andy |