如何增加菜单项aspx ASP.NET C#(WEB)的宽度和高度? [英] How to increase width and height of menu items aspx ASP.NET C# (WEB)?

查看:138
本文介绍了如何增加菜单项aspx ASP.NET C#(WEB)的宽度和高度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好/您好!

如何增加菜单项的宽度和高度,还添加一些背景和样式等。这是屏幕截图LINK

我想要那个数据库,表格,添加左侧的哪些选项都适合表格单元格,我一次又一次地尝试google it但我找不到解决方案,所以我在这里发帖..我知道代码项目有各种问题的解决方案。



我尝试了什么:



这是我的代码请帮我解决这个问题

Hi/Hello!
How to increase the width and height of menu items and also add some background and styles etc.Here is screen shot LINK
I want that database,tables,Add which options on the left side all are fit in the table cell,I tried again and again google it but I can't find the solution so i post here.. I know code project have every problem solution.

What I have tried:

Here is my code please help me how to resolve this issue

<table style="width: 100%">
<tr>
<td class="h50" style="height: 64px; font-size:large; color:Black">
<asp:Label ID="Label1" runat="server" Text="Home"></asp:Label>
</td>
</tr>
<tr>
<td style="height: 100px">
<table style="width: 100%; height: 166px">
<tr>
<td class="col_w450" style="width: 79px; background-color: #99CCFF;">
<asp:Menu ID="Menu1" runat="server" BackColor="#FFFBD6" 

 DynamicHorizontalOffset="2" Font-Names="Verdana" Font-Size="0.8em" 

 ForeColor="#990000" onmenuitemclick="Menu1_MenuItemClick" 

 StaticSubMenuIndent="10px">
<DynamicHoverStyle BackColor="#990000" ForeColor="White" /> <DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
<DynamicMenuStyle BackColor="#FFFBD6" />
<DynamicSelectedStyle BackColor="#FFCC66" />
 <Items>
 <asp:MenuItem Text="Database" Value="Database">
 <asp:MenuItem Text="Create datbase" Value="Create datbase"></asp:MenuItem>
 <asp:MenuItem Text="Update database" Value="Update database"></asp:MenuItem>
<asp:MenuItem Text="Delete database" Value="Delete database"></asp:MenuItem>
<asp:MenuItem Text="Tables" Value="Tables"></asp:MenuItem>
</asp:MenuItem>
</Items>
<StaticHoverStyle BackColor="#990000" ForeColor="White" />
<StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
<StaticSelectedStyle BackColor="#FFCC66" />
</asp:Menu>
</td>
<td rowspan="4" style="background-color: #FFFFCC">
 </td>
</tr><tr>

推荐答案

创建CSS文件并将其链接到页面的开头。

删除表格的所有内联样式并添加class =my-table(无论你喜欢什么名字)。如果你知道这个特殊的风格将是这一个,单个表(而不是一个表,相反,添加id =my-table。



To你的asp:菜单添加CssClass我的菜单



你的CSS:

Create CSS file and link it in the head of your page.
Remove all inline styling of your table and add class="my-table" (name it whatever you like). If you know this particular style will be for this one, single table (as opposed to more then one table, add id="my-table" instead.

To your asp:Menu add CssClass my-menu

Your CSS:
.my-table, /* this describes class my-table*/
#my-table /* this describes the table with id my-class*/
{
width: 100%;
height: 166px;
}

.col_w450 /* this is your menu container*/
{
width: 79px; background-color: #99CCFF;
}

/* here you add whatever properties you need on your menu*/
.my-menu { 
width: 150px;
height:24px;
line-height: 2em;
background-color: #FFFBD6;
}



如果哟你在做网络开发,学习CSS。 w3schools.com上有相当基础的教程,可以帮助你入门。



如果这有帮助,请接受解决方案。谢谢,祝你好运。


If you're doing web development, learn CSS. There is fairly basic tutorial at w3schools.com which should get you started.

If this helps, please accept the solution. Thank you and good luck.


这篇关于如何增加菜单项aspx ASP.NET C#(WEB)的宽度和高度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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