Alan wrote to Stephen...

>
> AFAIK there's no simple way around putting a common nav bar on every page, 
> other than by the use of Frames, which I wouldn't recommend.
>
>
>  ----- Original Message ----- 
>  From: Stephen Carrell
>  To: css-d@lists.css-discuss.org
>  Sent: Tuesday, August 05, 2008 2:46 PM
>  Subject: [css-d] Dynamic Navigation Link Aid
>
>
>  Hi all,
>
>  I'm new to this forum and relatively new to CSS-based web design, so 
> please
>  excuse my newb-ness over the following days/weeks/etc.
>
>  Can anyone help me out? I'd appreciate it; thanks!
>
>  Regards,
>
>  Stephen Carrell
>

08/05/2008

Stephen:

If I am understanding your question correctly, see here, 
http://www.whitehouseinwestbend.com/ and 
http://www.whitehouseinwestbend.com/whitehoxphp.css

The trick is to give the body tag for each page a unique id, such as <body 
id="indexpage">, and then give each nav list element its own id as well, 
such as <li id="navindex">, then use the CSS decendant selector to highlight 
the appropriate nav element. For the example page, it's...

body#WHIWBindex li#navindex a   {
        text-decoration: underline;
        color: white;
        background-color: #244893;
}

body#WHIWBschedule li#navschedule a     {
        text-decoration: underline;
        color: white;
        background-color: #244893;
}

body#WHIWBspecialevents li#navspecialevents a   {
        text-decoration: underline;
        color: white;
        background-color: #244893;
}

body#WHIWBmap li#navmap a       {
        text-decoration: underline;
        color: white;
        background-color: #244893;
}

so on and so forth. There may be more efficient ways to do this, but it 
works. Also, in this instance, I have stuck the nav block into a .php file 
so if I add pages, I only have to modify that file, not each individual 
page.

Hope this helps,

Best Regards,

Peter
www.fatpawdesign.com


______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to