ASP.NET menu control
I want to expand my menu names to the end of blue border, like on pict. http://img.villagephotos.com/p/2005-10/1086302/menu.JPG , what should I do in css ? i try with positioning and width.
CSS
div.menu ul li a, div.menu ul li a:visited
{
background-color: #465c71;
border: 1px #4e667d solid;
color: #dde4ec;
display:table;
line-height: 1.35em;
padding: 4px 20px;
text-decoration: none;
white-space: nowrap;
width: 80%;
position: relative;
}
< asp:Menu ID="NavigationMenu" Font-Bold="true" runat="server" CssClass="menu"
EnableViewState="false" IncludeStyleBlock="false" Orientation="Horizontal">
< Items>
< asp:MenuItem NavigateUrl="~/Default.aspx" Text="Home"/>
< asp:MenuItem Text="Projects" Value="Projects"
NavigateUrl="~/Projects.aspx">
< asp:MenuItem Text="SEED" Value="SEED" NavigateUrl="~/Seed.aspx">
</asp:MenuItem>
< asp:MenuItem Text="SEMS" Value="SEMS" NavigateUrl="~/SEMS.aspx">
</asp:MenuItem>
< asp:MenuItem Text="IPR" Value="IPR" NavigateUrl="~/IPR.aspx">
</asp:MenuItem>
< asp:MenuItem Text="Beneficiaries" Value="Beneficiaries"
NavigateUrl="~/Beneficiaries.aspx">
</asp:MenuItem>
< asp:MenuItem Text="About Us" Value开发者_开发知识库="About US"
NavigateUrl="~/About.aspx"></asp:MenuItem>
< asp:MenuItem Text="Contacts" Value="Contacts"
NavigateUrl="~/Contacts.aspx">
</asp:MenuItem>
</asp:MenuItem>
</Items>
</asp:Menu>
What I would advise is using set widths for the <li>
tags and the <div>
that has the list menu in.
ASP.NET will give your <li>
elements a generated ID so make classes like .home
and .projects
and apply them to the <asp:MenuItem cssClass="">
attribute
精彩评论