Jump to content

Need help with a sub Menu please


Zola
Go to solution Solved by cyberRobot,

Recommended Posts

Hey

 

I have a menu in place that works well on a website I am building. I use a php include so that the menu is served up the same over all the pages, nice and easy for updates etc.

 

I felt it was important to have an indicator on the selected menu item to reassure the user what page they are on.

 

Heres a code snippet of how I did this this. Using the .selected class in CSS  I simply changed the colour of the item.

<ul class="menu">
      <li><a href='index.php' <?php if( $page == 'index') echo 'class="selected"'?> ><span>Home</span></a></li>
       </ul>

I have another sub menu on a few pages that categories some content (I want these items to be on 6-7 pages). How could I do the same thing as above for these?

 

As you can see below, I already have a class name for these items, as I wanted them appear as a button I made.

    <a href="sub_item.php" class="icons_button"><i class="icon-tablet"> </i> Sub Item Example</a>
Edited by Zola
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.