Results 1 to 4 of 4

Thread: CSS and include files

  1. #1
    Join Date
    Sep 2006
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default CSS and include files

    Hi All,

    I'm trying to figure this out... Say I have 1 navigation include file with the following:

    home / about / products / contact

    And when someone is on the home page - the "home" style is set to "active" - might look like this:

    home / about / products / contact

    When on the products page the nav include file would be:

    home / about / products / contact

    Etc. etc.

    My question is: How do I "tell" the include file to set one of the navigation links to active while keeping the other links inactive? If that makes sense.

    Thanks.

  2. #2
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    are you talking about activating different style sheets?

    http://alistapart.com/articles/phpswitch/

  3. #3
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    You might want to read the thread entitled dynamic CSS selectors or declarations. That seems to cover what you're attempting.
    Mike

  4. #4
    Join Date
    Feb 2007
    Posts
    293
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    You could use Javascript and css to detect the page, and write an appropriate css depending on the URL. But a better way is to use just css.

    You give each link a unique id, then the body section of each page gets an id. Your style for the navigation then changes depending on which page the user is on. There's a good explanation at http://www.hicksdesign.co.uk/journal...-page-with-css

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •