[英]ASP:Menu : Need to apply CSS to make bulleted lists
I am using ASP:Menu and I would like to have the menu shown as below. 我正在使用ASP:Menu,我希望菜单显示如下。 Please suggest how to apply the CSS and what changes should I make? 请提出如何应用CSS的建议,我应该进行哪些更改?
Products 产品展示
Orders 命令
ASP:Menu code is as below. ASP:菜单代码如下。
<asp:Menu runat="server" ID="Navigator" MaximumDynamicDisplayLevels="0" StaticDisplayLevels="3"
Orientation="Vertical" DataSourceID="RelativeSiteMapDataSource" />
Update1: The current html that is generated by ASP:menu is shown below. Update1:ASP:菜单生成的当前html如下所示。
<ul class="Menu">
<li class="Menu-Leaf"><a href="prodxeon/products.aspx"; class="Menu-Link" title="Products">Products</a></li>
<li class="Menu-Leaf"><a href="prodxeon/orders.aspx"; class="Menu-Link" title="Orders">Orders</a></li>
<ul>
<li class="Menu-Leaf"><a href="http://pdxeon/po.aspx" class="Menu-Link" title="Purchase Orders">Purchase Orders</a></li>
<li class="Menu-Leaf"><a href="http://pdxeon/so.aspx" class="Menu-Link" title="Sales Orders">Sales Orders</a></li>
<ul>
<li class="Menu-Leaf"><a href="http://pdxeon/Bso.aspx" class="Menu-Link" title="Back Orders">Back Orders</a></li>
<li class="Menu-Leaf"><a href="http://pdxeon/iso.aspx" class="Menu-Link" title="Invoices">Invoices</a></li>
</ul>
</ul>
You can use this CSS: 您可以使用以下CSS:
ul.Menu { margin:0 1.5em 1.5em 1.5em; }
ul.Menu li { list-style-type:disc; }
ul.Menu ul { margin:0 3em 1.5em 1.5em; }
Keep in mind that your HTML is broken. 请记住,您的HTML已损坏。
<li class="Menu-Leaf"><a href="http://pdxeon/so.aspx" class="Menu-Link" title="Sales Orders">Sales Orders</a></li>
<ul> <--- this should be before the </li>. Lists must be nested. Any tag outside </li> is illegal.
Nested lists must follow this pattern: 嵌套列表必须遵循以下模式:
<ul>
<li>
<ul>
<li>...</li>
</ul>
</li>
</ul>
This is one of the problems with .NET controls - they isolate you from the HTML far too much, providing the developer with convenient ways to do things quickly, without understanding the fundamentals of how HTML actually works. 这是.NET控件的问题之一-它们将您与HTML隔离得太多,从而为开发人员提供了方便的方法来快速执行操作,而又不了解HTML实际工作原理。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.