防止 ASP.NET 菜单扩展至相邻内容
我有一个两列布局,在狭窄的左列中有一个垂直方向的 ASP.NET 菜单控件,在宽的右列中包含与所选菜单项相关的信息:
<div class="span-4">
<asp:Menu ID="categoryMenu" runat="server" Orientation="Vertical">
</asp:Menu>
</div>
<div id="product-grid-pane" class="span-12 last">
<asp:GridView ID="productGrid" runat="server" AutoGenerateColumns="false" ShowHeader="false" Width="100%">
</asp:GridView>
</div>
如果菜单项包含长文本,则菜单将简单地展开到网格。我怎样才能防止这种情况发生?我在这里可能需要两个答案:纯 CSS 答案,如果菜单控件呈现漂亮、简单的 UL 元素,这将非常好,但它似乎更喜欢基于难以理解的表的结构,我可能需要额外的帮助来正确设置样式。
I have a two column layout, with a vertically oriented ASP.NET menu control in a narrow left column, and info related to the selected menu item in a wide right column:
<div class="span-4">
<asp:Menu ID="categoryMenu" runat="server" Orientation="Vertical">
</asp:Menu>
</div>
<div id="product-grid-pane" class="span-12 last">
<asp:GridView ID="productGrid" runat="server" AutoGenerateColumns="false" ShowHeader="false" Width="100%">
</asp:GridView>
</div>
If a menu item contains long text, the menu simply expands over the grid. How can I prevent this? I might need two answers here: the pure CSS one, which would be very nice if the menu control rendered nice, simple UL elements, but it seems to prefer an impenetrable table based structure I may need additional help styling properly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用的是 ASP.net 4.0,Menu 控件有一个名为
RenderingMode
的属性,您可以将其设置为Table
或List
。否则,也许您可以提供表格
width:100%
和table-layout:fixed
以及包含的 divoverflow:hidden
。If you are using ASP.net 4.0 the Menu control has a property named
RenderingMode
which you can set toTable
or toList
.Otherwise perhaps you can give the Table
width:100%
andtable-layout:fixed
and your containing divoverflow:hidden
.