Although the Property inspector enables you to make simple edits to a Menu Bar widget, it does not support customized styling tasks. You can alter the CSS rules for the Menu Bar widget and create a menu bar that is styled to your liking. For a more advanced list of styling tasks, see www.adobe.com/go/learn_dw_sprymenubar_custom.
Although you can easily edit rules for the Menu
Bar widget directly in the accompanying CSS file, you can also use
the CSS Styles panel to edit the menu bar’s CSS. The CSS Styles
panel is helpful for locating the CSS classes assigned to different
parts of the widget, especially if you use the panel’s Current mode.
Change text styling of a menu itemThe CSS attached to the <a> tag contains the information for text styling. There are also several relevant text styling class values attached to the <a> tag that pertain to different menu states.
To change the text styling of a menu item, use
the following table to locate the appropriate CSS rule, and then
change the default value:
|
Style to change |
CSS rule for vertical or horizontal menu bar |
Relevant properties and default values |
|---|---|---|
|
Default text |
ul.MenuBarVertical a, ul.MenuBarHorizontal a |
color: #333; text-decoration: none; |
|
Text color when mouse pointer moves over it |
ul.MenuBarVertical a:hover, ul.MenuBarHorizontal a:hover |
color: #FFF; |
|
Text color when in focus |
ul.MenuBarVertical a:focus, ul.MenuBarHorizontal a:focus |
color: #FFF; |
|
Menu Bar item color when mouse pointer moves over it |
ul.MenuBarVertical a.MenuBarItemHover, ul.MenuBarHorizontal a.MenuBarItemHover |
color: #FFF; |
|
Submenu item color when mouse pointer moves over it |
ul.MenuBarVertical a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal a.MenuBarItemSubmenuHover |
color: #FFF; |
Change the background color of a menu itemThe CSS attached to the <a> tag contains the information for a menu item’s background color. There are also several relevant background color class values attached to the <a> tag that pertain to different menu states.
To change the background color of a menu item,
use the following table to locate the appropriate CSS rule, and
then change the default value:
|
Color to change |
CSS rule for vertical or horizontal menu bar |
Relevant properties and default values |
|---|---|---|
|
Default background |
ul.MenuBarVertical a, ul.MenuBarHorizontal a |
background-color: #EEE; |
|
Background color when mouse pointer moves over it |
ul.MenuBarVertical a:hover, ul.MenuBarHorizontal a:hover |
background-color: #33C; |
|
Background color when in focus |
ul.MenuBarVertical a:focus, ul.MenuBarHorizontal a:focus |
background-color: #33C; |
|
Menu Bar item color when mouse pointer moves over it |
ul.MenuBarVertical a.MenuBarItemHover, ul.MenuBarHorizontal a.MenuBarItemHover |
background-color: #33C; |
|
Submenu item color when mouse pointer moves over it |
ul.MenuBarVertical a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal a.MenuBarItemSubmenuHover |
background-color: #33C; |
Change the dimension of menu itemsYou change the dimension of menu items by changing the width properties of the menu item’s li and ul tags.
Position submenus