ASP菜单宽度不设置为100% [英] ASP Menu width not setting to 100%
本文介绍了ASP菜单宽度不设置为100%的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用ASP菜单垂直导航条。和我想的宽度设置为100%,但它仍然是因为它是。
下面是code我使用。
< DIV ID =leftcolumn>
< ASP:菜单ID =菜单1=服务器的CssClass =菜单的renderingMode =列表>
<项目>
< ASP:菜单项文本=收件箱VALUE =收件箱>< / ASP:菜单项>
< ASP:菜单项文本=处理>< / ASP:菜单项>
< ASP:菜单项文本=aslkdjf>< / ASP:菜单项>
< ASP:菜单项文本=aslkdjf>< / ASP:菜单项>
< ASP:菜单项文本=aslkdjf>< / ASP:菜单项>
< /项目>
< / ASP:菜单>
< / DIV>
下面是对的CssClass格(leftcolumn)!
#leftcolumn {
浮动:左;
宽度:200像素; / *左侧立柱宽度* /
保证金左:-100%;
背景:#C8FC98;}
下面是CSS类的菜单
。菜单
{
FONT-FAMILY:'打开三世,无衬线;
字体大小:13像素;
宽度:汽车;
}。菜单UL
{
列表样式类型:无;
保证金:0;
填充:0;
保证金底:0; / *每个UL和内容的其余部分之间的间距底部* /
}。菜单UL李
{
填充底:2px的; / *菜单项之间的间距底部* /}。菜单UL李一
{
颜色:黑色;
背景:#E9E9E9;
显示:块;
填充:为5px 0;
行高:知识+;
填充左:8像素; / *链接文本缩进8像素* /
文字修饰:无;
}。菜单UL李一:悬停
{
背景图片:无;
颜色:白色;
背景:黑色;
}
这是菜单。
我需要用ASP:菜单控制,因为我必须动态访问控制服务器端,并进行更改
您能帮我吗?
解决方案
菜单UL李
{
!宽度:150像素重要;
填充底:2px的; / *菜单项之间的间距底部* /
}
我添加了width属性,定义一个固定长度到它。那么我的问题就解决了。
I'm making a Vertical Navigation bar using Asp Menu. and I'm trying to set the Width to 100% but It remains as it is.
Here is the Code i'm using.
<div id="leftcolumn" >
<asp:Menu ID="Menu1" runat="server" CssClass="Menu" RenderingMode="List">
<Items>
<asp:MenuItem Text="Inbox" Value="inbox"></asp:MenuItem>
<asp:MenuItem Text="Processing"></asp:MenuItem>
<asp:MenuItem Text="aslkdjf"></asp:MenuItem>
<asp:MenuItem Text="aslkdjf"></asp:MenuItem>
<asp:MenuItem Text="aslkdjf"></asp:MenuItem>
</Items>
</asp:Menu>
</div>
Here is the CssClass for Div (leftcolumn)!
#leftcolumn{
float: left;
width: 200px; /*Width of left column*/
margin-left: -100%;
background: #C8FC98;}
Here is the Css Class for Menu
.Menu
{
font-family: 'Open Sans', sans-serif;
font-size: 13px;
width:auto;
}
.Menu ul
{
list-style-type: none;
margin: 0;
padding: 0;
margin-bottom: 0; /*bottom spacing between each UL and rest of content*/
}
.Menu ul li
{
padding-bottom: 2px; /*bottom spacing between menu items*/
}
.Menu ul li a
{
color: black;
background: #E9E9E9;
display: block;
padding: 5px 0;
line-height: 17px;
padding-left: 8px; /*link text is indented 8px*/
text-decoration: none;
}
.Menu ul li a:hover
{
background-image: none;
color: white;
background: black;
}
Here is the Menu.
I need to use the Asp:menu Control because I have to access the Control in the server side and make changes to it Dynamically.
Can you Help me?
解决方案
Menu ul li
{
width:150px !important;
padding-bottom: 2px; /*bottom spacing between menu items*/
}
I Added The Width Property and Defined a fixed length to it. then my problem is solved.
这篇关于ASP菜单宽度不设置为100%的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文