Possible to have current page button highlighted with DW Spry menu bar?

I have used DW's Spry menu bar on my page. I would like the current page button to show as active when the page is seen - ie in Flat 1's page, below, the button for Flat 1 will be highlighted. I can't see how to do this, is it possible?

www.brownsox.co.uk/Dummy/flat2lightbox.html
BigpollyAsked:
Who is Participating?
 
LZ1Commented:
You don't need to specify the 2nd a in a:hover. Try this:
ul.MenuBarHorizontal a.activetab:hover, ul.MenuBarHorizontal a:focus
{
      background-color: #FFF;
      color: #069; /*this doesn't work*/
}      
 
0
 
SteveIT ManagerCommented:
I'll have a look
0
 
blacksixCommented:
I'm getting a 404 error to that url...

is this the page you meant t post?

http://www.brownsox.co.uk/Dummy/flat1lightbox.html
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
LZ1Commented:
The url you have is not working.  
To answer your question, you would have to give the menu button a class such as selected or current and then assign special css to it to "highlight" it.  
Here's one example that uses the body id to specify:
http://www.pmob.co.uk/temp/nav-body.htm 
Here's a real good article that describes 3 ways to do it
http://www.apaddedcell.com/highlight-links-current-page-css 
0
 
blacksixCommented:
to elaborate on LZ1's comment, here's an example...

add this css to your page:

.active_tab {
background-color: black;
}

then in the html code on flat1lightbox.html your it would look like this
    <ul id="MenuBar1" class="MenuBarHorizontal">
      <li><a href="#">Home</a>      </li>
      <li><a href="#" class="active_tab">Flat 1</a></li>
      <li><a href="#">Flat 2</a></li>
      <li><a href="#">Flat 3</a></li>
      <li><a href="#">Flat 4</a></li>
      <li><a href="#">Flat 5</a>      </li>
      <li><a href="#">Barnoon </a></li>
    </ul>

on flat2lightbox.html it would be

so on flat1lightbox.html your code will look like this
    <ul id="MenuBar1" class="MenuBarHorizontal">
      <li><a href="#">Home</a>      </li>
      <li><a href="#" >Flat 1</a></li>
      <li><a href="#" class="active_tab">Flat 2</a></li>
      <li><a href="#">Flat 3</a></li>
      <li><a href="#">Flat 4</a></li>
      <li><a href="#">Flat 5</a>      </li>
      <li><a href="#">Barnoon </a></li>
    </ul>

etc. etc.
0
 
BigpollyAuthor Commented:
Huge apologies - yes it should have been
www.brownsox.co.uk/Dummy/flat1lightbox.html

I'll look at the answers I've received asap. Looks good though.
0
 
LZ1Commented:
Any updates?
0
 
BigpollyAuthor Commented:
I've done exactly what blacksix suggested, and which looks clear and fine to me from my limited understanding of css - but it's not working. The flat 1 button is unchanged. Is the solution wrong or have I messed up somehow?
www.brownsox.co.uk/Dummy/flat1lightbox.html

Thank you
0
 
LZ1Commented:
Which link is supposed to be the "current one"?  
You will need to add a class of active_tab to the link as specified above.
0
 
BigpollyAuthor Commented:
Flat 1 is current and I have done that, as I understand it:
In the css:

.activetab {
      background-color: #FFF;
      color: #069;

and in the html:

<ul id="MenuBar1" class="MenuBarHorizontal">
      <li><a href="#">Home</a></li>
      <li><a href="#" class="activetab">Flat 1</a></li>
      <li><a href="#">Flat 2</a></li>
      <li><a href="#">Flat 3</a></li>
      <li><a href="#">Flat 4</a></li>
      <li><a href="#">Flat 5</a>      </li>
      <li><a href="#">Barnoon </a></li>
0
 
LZ1Commented:
Your going to have to target it more directly.  In your CSS where you have ul.MenuBarHorizontal a
Try duplicating it and then adding the class at the end like this:
 

ul.MenuBarHorizontal a.activetab.
{ background-color:#FFFFFF; color:#006699; 

Open in new window

0
 
BigpollyAuthor Commented:
That's brilliant thank you so much!
I'm now trying to remove the background on rollover also and tried the second ul instruction below, which seemed to follow the logic of your solution - it doesn't work though any ideas?
ul.MenuBarHorizontal a.activetab
{
      background-color:#FFF; color:#069;
      border-bottom: 0 /*this works great*/
}
ul.MenuBarHorizontal a.activetab a:hover, ul.MenuBarHorizontal a:focus
{
      background-color: #FFF;
      color: #069; /*this doesn't work*/
}      
/* Menu items that have mouse over or focus have a blue background and white text */
ul.MenuBarHorizontal a:hover, ul.MenuBarHorizontal a:focus
{
      background-color: #B7C9DF;
      color: #069;
}
0
 
BigpollyAuthor Commented:
Superstar! Thank you very much.
0
 
BigpollyAuthor Commented:
Brilliant - speedy responses and got me all the answers.
0
 
LZ1Commented:
Your very welcome!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.