Using the CSSPrefix property for design of sub-menus

The CSSPrefix property allows you not only to use several menu controls with different styles on one page, but also to specify style of menu sub-items at any chosen level.

 

Here's an example of how to specify various style for particular menu levels (it can be used for both CMSMenu and CMSTreeMenu):

 

First, you need to specify the list of prefixes for particular levels using the CSSPrefix property:

 

CMSMenu1.CSSPrefix = "MainMenu;MainMenuSubMenu;MainMenuOtherLevels"

 

... now you define the following styles:

 

.MainMenuCMSMenu

... for menu control

 

.MainMenuCMSMenuItem

.MainMenuCMSMenuItemMouseUp

... etc. for the first level of the menu (level 0)

 

.MainMenuSubMenuCMSMenu

.MainMenuSubMenuCMSMenuItemMouseUp

... etc. for the second level of the menu (level 1)

 

.MainMenuOtherLevelsCMSMenu

.MainMenuOtherLevelsCMSMenuItemMouseUp

... etc. for all underlying levels of the menu (level 2 and all higher levels)