动态菜单帮助使用CSS [英] dynamic menu help on using css

查看:66
本文介绍了动态菜单帮助使用CSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用动态菜单,其中菜单项取自数据库..为了设计菜单,我使用的代码如下所示:



< pre lang =xml> < asp:菜单 ID = menuBar runat = server 方向 = 水平 MaximumDynamicDisplayLevels = 10

< span class =code-attribute> CssClass = menuHeader >

< DynamicMenuItemStyle CssClass = DynamicMenuItemStyle / >

< ; / asp:菜单 >





DynamicMenuItemStyle没有采用css的属性.. css是这样的..



 DynamicMenuItemStyle  
{
margin inherit;
border-left 0px solid#c1c1c1;
vertical-align middle;
height 12px;
text-align < span class =code-keyword> left;
color < span class =code-keyword>#000000;
padding 5px;
background-color #C0C0C0;
font-family Tahoma;
}







任何人的帮助??

解决方案

在所有情况下, DynamicMenuItemStyle 不是HTML元素,因此,它不能拥有CSS类。



你可以运行你的应用程序,看看菜单代码从浏览器看起来如何,看看它是如何工作的HTML 。为此,只需在浏览器中加载页面,然后通过查看页面源(或类似的东西,取决于浏览器)查看HTML代码。总是一个很好的锻炼。 :-)



要查看菜单的实际样式,请注意 DynamicMenuStyle

http: //msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.menu.dynamicmenustyle.aspx [ ^ ]。



-SA


尝试直接为DynamicMenuItemStyle应用样式,并仔细检查它是否正常工作。如果样式以这种方式工作,那么之前可能没有正确引用您的css文件路径。尝试再次正确地将页面中的引用添加到css文件。


visit这里..





http://stackoverflow.com/questions/11596991/how-can-i-build-a-dynamic-menu-using-css-and-javascript [ ^ ]







http://kb.worldsecuresystems.com/kb/creating-dynamic-menu-using-css.html [ ^ ]

I am using a dynamic menu where menu item is taken from database.. In order to design a menu I am using a code as shown below:

<asp:Menu ID="menuBar" runat="server" Orientation="Horizontal" MaximumDynamicDisplayLevels="10"

                       CssClass="menuHeader">

                       <DynamicMenuItemStyle CssClass="DynamicMenuItemStyle"/>

                   </asp:Menu>



DynamicMenuItemStyle is not taking the properties of css.. The css is like this..

.DynamicMenuItemStyle
{
    margin: inherit;
    border-left: 0px solid #c1c1c1;
    vertical-align: middle;
    height: 12px;
    text-align: left;
    color: #000000;
    padding: 5px;
    background-color: #C0C0C0;
    font-family: Tahoma;
}




any help from anyone??

解决方案

In all cases, DynamicMenuItemStyle is not an HTML element, hence, it cannot have the CSS class.

You can run your application and look how the menu code looks from the browser, to see how it works in terms of HTML. To do so, just load your page in the browser and look at the HTML code through "View Page Source" (or something like that, which depends on the browser). Always a good exercise. :-)

To see how menu is actually styled, please pay attention for the code sample in the MSDN page on DynamicMenuStyle:
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.menu.dynamicmenustyle.aspx[^].

—SA


Try applying the styles directly for the DynamicMenuItemStyle and see to double check whether its working. If the styles are working in that way then there are chances that your css file path might was not referenced properly earlier.Try adding the reference in your page to the css file again properly.


visit here..


http://stackoverflow.com/questions/11596991/how-can-i-build-a-dynamic-menu-using-css-and-javascript[^]

or

http://kb.worldsecuresystems.com/kb/creating-dynamic-menu-using-css.html[^]


这篇关于动态菜单帮助使用CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆