[EMAIL PROTECTED] wrote:
> Hi,
> 
> Just say I have 4 pages on a website. When I am on a page I want the button 
> on that particular page to be bold and a different colour so the user know 
> what page they are on.
> 
> Is there a css only way to do this, or a better way?. At present I am setting 
> php variables like this(in this example I am on the 'location page' as it has 
> the selected class aswell as the sub_selcted class).......Is there a better 
> way to do this?
> 
> 

Give each button an id, and set an id on the body of the page:

<body id="page1"><!-- this id will be different on each page -->
    <ul>
       <li id="page1Link"><a href="page1.html">Page 1</a></li>
       <li id="page2Link"><a href="page2.html">Page 2</a></li>
       <li id="page3Link"><a href="page3.html">Page 3</a></li>
    </ul>
</body>

Then apply your default styling, in this case a normal-weight font:

li {
    font-weight: normal;
}

Then specify what to do for the combinations of body id and the 
corresponding button id, in this make the <li> for the current page have 
a bold font:

#page1 #page1Link,
#page2 #page2Link,
#page3 #page3Link {
    font-weight: bold;
}

You should be able to extrapolate from this to something that suits your 
particular application.

HTH,

Nick.
-- 
Nick Fitzsimons
http://www.nickfitz.co.uk/


______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to