Page 1 of 1

give a different class to a list item

Posted: Wed Jan 28, 2009 11:19 am
by pedes
I would like to give every list item a different class, with this i can change text to images in the list.
For every list item I have 2 gifs images, onhover the image is changing.
In original html/css is this really easy to do, but here the menu is controlled by cmsms and I don't know how to get that different class="menu..." in the list line.

this is the html:
div class="menu">
 
    1
    2
 
this is the css:
.menu ul { list-style:none; padding:0; margin:0; }
.menu ul li a { text-indent:-9000px; display:block; width:250px; margin-right:0px; }
.menu ul li.menu1 a { height:53px; background:url(../images/menu_a.gif); background-repeat: no-repeat; }
.menu ul li.menu1 a:hover { height:53px; background:url(../images/menu_aa.gif); background-repeat: no-repeat; }
.menu ul li.menu2 a { height:94px; background:url(../images/menu_b.gif); background-repeat: no-repeat; }
.menu ul li.menu2 a:hover { height:94px; background:url(../images/menu_bb.gif); background-repeat: no-repeat; }
Can anyone help me out?

Thanks,
Peter

Re: give a different class to a list item

Posted: Wed Jan 28, 2009 3:33 pm
by tophers
I've done it using instead of , but this example should get you going:
http://forum.cmsmadesimple.org/index.ph ... #msg142449

Re: give a different class to a list item

Posted: Wed Jan 28, 2009 7:22 pm
by Dr.CSS
Change the menu template to take the class={$node->alias} then change the css accordingly...