give a different class to a list item

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"
Post Reply
pedes
Power Poster
Power Poster
Posts: 840
Joined: Tue Jan 27, 2009 11:47 am

give a different class to a list item

Post 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
User avatar
tophers
Forum Members
Forum Members
Posts: 218
Joined: Thu Jun 07, 2007 7:25 pm

Re: give a different class to a list item

Post by tophers »

I've done it using instead of , but this example should get you going:
http://forum.cmsmadesimple.org/index.ph ... #msg142449
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: give a different class to a list item

Post by Dr.CSS »

Change the menu template to take the class={$node->alias} then change the css accordingly...
Post Reply

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