Results 1 to 2 of 2

Thread: navigation css for each page applied to ul

  1. #1
    User
    Join Date
    01-26-10.
    Posts
    37

    Default navigation css for each page applied to ul

    Hi

    Is there a way to apply a css class to the ul element of the navigation module (customnav) for each page ?
    If I go to the site structure and assign a css class to a page, the class is papplied to the active li element of the menu.
    I need to access the ul element, and assign to it a different css class for each page.

    Second question : I use the css attribute nth-child(n) to modify the background color of my menu items (each item has a different color). It doesn't work on I.E. do you know how can I achieve it easily ?
    Code:
    #menu li:nth-child(3)
    {
    background-color:#97005E;
    }
    Thank you

  2. #2
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: navigation css for each page applied to ul

    both can be done using a custom template. the first by looping through your items and extracting the classes prior to outputting the html. the second by adding a class name using an incrementing counter.

    neither can be done via contao settings/templates. small chance you'd be able to do this using extension, but don't count on that. I'd say you need to make a custom nav template.

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
  •