1. 程式人生 > >控制元件 應用css樣式

控制元件 應用css樣式

[html] view plaincopyprint?
  1. <asp:MenuID="mnuTopMenu"runat="server"DynamicEnableDefaultPopOutImage="False"
  2. DynamicHorizontalOffset="-1"Font-Bold="false"Orientation="Horizontal"StaticEnableDefaultPopOutImage="False"
  3. StaticSubMenuIndent="10px"DisappearAfter="600"
  4. StaticSelectedStyle-CssClass="StaticSelectedStyle"
  5. StaticMenuItemStyle-CssClass="StaticMenuItemStyle"
  6. StaticHoverStyle-CssClass="StaticHoverStyle"
  7. DynamicMenuStyle-CssClass="DynamicMenuStyle"
  8. DynamicSelectedStyle-CssClass="DynamicSelectedStyle"
  9. DynamicMenuItemStyle-CssClass="DynamicMenuItemStyle"
  10. DynamicHoverStyle-CssClass="DynamicHoverStyle"
  11. onmenuitemclick
    ="mnuTopMenu_MenuItemClick">
  12. <Items></Items>
  13. </asp:Menu>
<asp:Menu ID="mnuTopMenu" runat="server" DynamicEnableDefaultPopOutImage="False"
                    DynamicHorizontalOffset="-1" Font-Bold="false" Orientation="Horizontal" StaticEnableDefaultPopOutImage="False"
                    StaticSubMenuIndent="10px" DisappearAfter="600" 
                    StaticSelectedStyle-CssClass="StaticSelectedStyle"
                    StaticMenuItemStyle-CssClass="StaticMenuItemStyle"
                    StaticHoverStyle-CssClass="StaticHoverStyle"
                    DynamicMenuStyle-CssClass="DynamicMenuStyle"
                    DynamicSelectedStyle-CssClass="DynamicSelectedStyle"
                    DynamicMenuItemStyle-CssClass="DynamicMenuItemStyle"
                    DynamicHoverStyle-CssClass="DynamicHoverStyle"
                     onmenuitemclick="mnuTopMenu_MenuItemClick" >
                  <Items></Items>
                </asp:Menu>

css樣式如下:

[css] view plaincopyprint?
  1. .mnuTopMenu  
  2. {  
  3. background-color:Transparent;  
  4. font-family: 宋體;  
  5. font-size12px;  
  6. position:relative;  
  7.     top:34px;  
  8. }  
  9. .DynamicMenuStyle /*動態選單矩形區域樣式*/
  10. {  
  11. background-colorwhite;  
  12. bordersolid1px#ACC3DF;  
  13. padding1px1px1px1px;  
  14. text-alignleft;  
  15. }  
  16. .DynamicHoverStyle /*動態選單項:滑鼠懸停時的樣式*/
  17. {  
  18. background-color#F7DFA5/*#7C6F57;*/
  19. color#333333;  
  20. }  
  21. .DynamicSelectedStyle /*動態選單項:選擇時的樣式*/
  22. {  
  23. /*background-color:Gainsboro;*/
  24. colorred;  
  25. }  
  26. .DynamicMenuItemStyle /*動態選單項樣式*/
  27. {  
  28. padding2px5px2px5px;  
  29. color#333333;  
  30. }  
  31. .StaticSelectedStyle /*靜態選單項:選擇時的樣式*/
  32. {  
  33. /*background-color:Gainsboro;*/
  34. colorred;  
  35. }  
  36. .StaticMenuItemStyle /*靜態選單項樣式*/
  37. {  
  38. cursor: hand;  
  39. padding2px5px2px5px;  
  40. color#333333;  
  41. background-color::Transparent;  
  42. }  
  43. .StaticHoverStyle /*靜態選單項:滑鼠懸停時的樣式*/
  44. {  
  45. background-color#84BCCD/*#7C6F57;*/
  46. cursor: hand;  
  47. color#333333;  
  48. }