changing colors for odd and even navigation elements

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Locked
bazcoop

changing colors for odd and even navigation elements

Post by bazcoop »

Hi all,

I want to create a nav bar similar to http://tatteredfly.com/ left nav.  which used:

CSS;

ul.nav {
margin:0;
padding:0;
color:#333399;
}

ul.nav li {
list-style:none;
margin-bottom:2px;
padding:4px 4px 4px 10px;
}

ul.nav li.odd {
background:#33CC99;
}

ul.nav li.even {
background:#009933;
}

and HTML


    one
    two
    three
    four
    five


But i need to automate this using menu manager.

Any ideas.

Thanks

Barry Cooper
bterkuile
Forum Members
Forum Members
Posts: 97
Joined: Sun Jul 22, 2007 11:48 am

Re: changing colors for odd and even navigation elements

Post by bterkuile »

The smarty cycle command should work. This example is with random names, but should give a hint

Code: Select all

{section name=name loop=$menu}
<li class="{cycle values="even,odd"}"> {$menu[name]}</li>
{/section}
barry cooper
Forum Members
Forum Members
Posts: 63
Joined: Fri Jul 13, 2007 6:49 am

Re: changing colors for odd and even navigation elements

Post by barry cooper »

Thanks for the help

I have been working on a different project for a while...

Regards

Barry Cooper
Locked

Return to “Layout and Design (CSS & HTML)”