CSS and CMenu


I would like to add more CSS to a CMenu call than is easily apparent to me… What I want to be able to do is specify the width of individual <li> elements, either via a CSS class or CSS id. I am able to get the overall look ok with styling the div that contains the menu, but there are a variety of widths to the menu segments that either do a line break or are too wide. Does the itemOptions array of the items property allow me to control this? and if it does might anyone have an example of syntax for assigning class or id?




				array('label'=>'About', 'url'=>array('/site/page', 'view'=>'about'), 'itemOptions'=>array('class'=>'about')),


Thanks!! I just figured out how to sort it out with plain old CSS, but this could come in handy…

Is it possible to set individual css class for every active menu items?

For example first active link get ‘active1’ class, second ‘active2’ class etc?

I want to set colorful underline (for every element another color) using images when element is active.

Yes you can do that.

<?php $this->widget('zii.widgets.CMenu',array(



                array('label'=>'Contact Us/FAQ', 'url'=>array('site/faq'),'itemOptions'=>array('id'=>'lastLi')),'linkOptions'=>array('class'=>'sd'),


        ))); ?>