|
Posted by Andy Dingley on 06/21/07 10:37
On 20 Jun, 19:57, Rich Bradshaw <Rich.Brads...@gmail.com> wrote:
> Sorry about the long title -
It did rather confuse me. I thought you'd be talking about links with
only fragment identifiers (i.e. same page) rather than a navigation
menu and a notion of "current selection" on the menu (which doesn't
even need to always be to the same page)
> I have a page with a navbar on. I would
> like like to make it so that the links that link to the page the user
> is on are a different color.
<li class="current" >...</li>
Simple, works beautifully.
> The problem is, that I want to keep the menu in a file so that I can
> server side include it, so I don't want to have to change it manually
> for each page.
Not so easy, but still a well-known problem
<body class="page-foo" >
....
<!-- SSI begins here -->
...
<li class="nav-foo" >...</li>
<li class="nav-bar" >...</li>
<li class="nav-bat" >...</li>
...
<!-- SSI ends here -->
....
And in the CSS,
li.current,
..page-foo .nav-foo,
..page-bar .nav-bar,
..page-bat .nav-bat
{ background-color: red; }
Obviously you tweak the parent element of each page differently, but
that's easy
[Back to original message]
|