本文介绍了ASP.NET菜单控制器移动到中心的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好
我想将菜单控制器移到中心,任何可以帮助我的人
这里是我的代码:
html:
Hi there
I want to move my menu controller to the center,any one who can help me
here is my code:
html:
<div class="header">
<div class="clear hideSkiplink">
<asp:Menu ID="NavigationMenu" runat="server" CssClass="menu"
StaticMenuStyle-CssClass="menu"
StaticMenuItemStyle-CssClass="menu"
EnableViewState="false" IncludeStyleBlock="false"
Orientation="Horizontal" RenderingMode="List" ItemWrap="false" Font-Size="Small">
<Items>
<asp:MenuItem NavigateUrl="~/Home/Default.aspx" Text="Home" />
<asp:MenuItem NavigateUrl="industrysolutions/OurApproach .aspx" Text="our approach " />
<asp:MenuItem NavigateUrl="~/solutionlayers/solutionlayers.aspx" Text="solutions"/>
<asp:MenuItem NavigateUrl="~/industrysolutions/industrysolutions.aspx" Text="industries"/>
<asp:MenuItem NavigateUrl="~/partners/technologypartners.aspx" Text="partners"/>
<asp:MenuItem NavigateUrl="~/newsroom/pressreleases.aspx" Text="newsroom"/>
<asp:MenuItem NavigateUrl="~/About/TheTeam.aspx" Text="About Dac" />
<asp:MenuItem NavigateUrl="~/contactus/contactdetails.aspx" Text="contact us" />
</Items>
</asp:Menu>
</div>
<table class="HeaderTable" cellspacing="0" cellpadding="0">
<tr>
<td class="HeaderLogoCell" >
<asp:Image ID="Image1" runat="server" ImageUrl="~/Images/dac_logo.png" />
</td>
<td class="HeaderMenuCell">
<asp:Menu ID="SubMenu" runat="server" CssClass="menuSub"
EnableViewState="false" IncludeStyleBlock="false" Orientation="Horizontal"
BorderStyle="None" RenderingMode="List">
<DynamicMenuStyle CssClass="IE8Fix" />
<Items>
<%--<asp:MenuItem NavigateUrl="~/partners/technologypartners.aspx" Text="technology partners"/>
<asp:MenuItem NavigateUrl="~/partners/channelpartners.aspx" Text="channel partners"/>--%>
</Items>
</asp:Menu>
</td>
</tr>
</table>
</div>
CSS:
CSS:
/* TAB MENU
----------------------------------------------------------*/
div.hideSkiplink
{
width: 960px;
margin-left: 15px;
margin-top: 5px;
text-align:center;
}
.HeaderTable
{
width: 980px;
padding: 0px;
margin: 8px 0px 0px 8px;
vertical-align: top;
border-spacing: 0px;
}
.HeaderLogoCell
{
text-align:left;width:305px; padding-top:21px; padding-left:120px;
}
.HeaderMenuCell
{
vertical-align:top;
}
div.menu
{
margin-top: 5px;
padding: 0px 0px 0px 0px;
table-layout:fixed;
width: 960px;
}
div.menu ul
{
list-style: none;
margin: 0px;
padding: 0px;
width: auto;
}
div.menu li
{
display: inline-block;
text-align: center;
}
div.menu ul li a, div.menu ul li a:visited
{
/*letter-spacing: 1px;*/
color: #FFFFFF;
display: block;
line-height: 26px;
padding: 0px;
text-decoration: none;
text-transform: lowercase;
width: 135px;
white-space: nowrap;
border-right-style: solid;
border-right-width: 1px;
border-right-color: #FFFFFF;
text-align: center;
}
div.menu li:last-child a {
border:none;
}
div.selected
{
font-weight: bold;
}
请注意这不是我创建的!我只是更新网站
注意:我还是更瘦!
Please note this was not created by me!am just only updating the website
NB:am still a leaner!
推荐答案
<asp:menu id="NavigationMenu" runat="server" style="top: 23px; left: 7px; position: absolute; height: 26px; width: 938px" xmlns:asp="#unknown">
CssClass="menu"
StaticMenuStyle-CssClass="menu"
StaticMenuItemStyle-CssClass="menu"
EnableViewState="false" IncludeStyleBlock="false"
Orientation="Horizontal" RenderingMode="List" ItemWrap="false"
Font-Size="Small">
<items>
<asp:menuitem navigateurl="~/Home/Default.aspx" text="Home" />
<asp:menuitem navigateurl="industrysolutions/OurApproach .aspx" text="our approach " />
<asp:menuitem navigateurl="~/solutionlayers/solutionlayers.aspx" text="solutions" />
<asp:menuitem navigateurl="~/industrysolutions/industrysolutions.aspx" text="industries" />
<asp:menuitem navigateurl="~/partners/technologypartners.aspx" text="partners" />
<asp:menuitem navigateurl="~/newsroom/pressreleases.aspx" text="newsroom" />
<asp:menuitem navigateurl="~/About/TheTeam.aspx" text="About Dac" />
<asp:menuitem navigateurl="~/contactus/contactdetails.aspx" text="contact us" />
</items>
</asp:menu>
使用此代码我已包含样式
Use This code I have included the style
这篇关于ASP.NET菜单控制器移动到中心的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!