I am building an asp.net website where I need a horizontal asp menu to be the full screen width with 10 items each of 10% width.
Please suggest a solution because when I set menu width to 100% and li
width to 10 % it doesn't come in full width.
However when I set menu width to 1280(my resolution) and li
width to 128 it works fine.
The problem with approach is not everyone has the same resolution
Html code of asp.net menu:
<div>
<asp:Menu ID="NavigationMenu" runat="server" CssClass="menu"
EnableTheming="False" EnableViewState="False"
IncludeStyleBlock="False" Orientation="Horizontal" Width="1280px">
<Items>
<asp:MenuItem Text="HOME" Value="ADD CITY" NavigateUrl="~/Content.aspx"></asp:MenuItem>
<asp:MenuItem NavigateUrl="~/addcity.aspx" Text="NEW CITY" Value="ADD CITY">
</asp:MenuItem>
<asp:MenuItem Text="NEW DATA" Value="SUBMIT DATA" NavigateUrl="~/adddata.aspx"></asp:MenuItem>
<asp:MenuItem Text="SHOPING" Value="SHOPING">
</asp:MenuItem>
<asp:MenuItem Text="OFFERS" Value="OFFERS"></asp:MenuItem>
<asp:MenuItem Text="BUSINESS" Value="BUSINESS"></asp:MenuItem>
<asp:MenuItem Text="CLASSIFIED" Value="CLASSIFIED"></asp:MenuItem>
<asp:MenuItem Text="EDUCATION" Value="EDUCATION"></asp:MenuItem>
<asp:MenuItem Text="ISSUES" Value="ISSUES"></asp:MenuItem>
<asp:MenuItem Text="SERVICES" Value="SERVICES"></asp:MenuItem>
</Items>
</asp:Menu>
</div>
i tried to make it well-formatted. Now please help.
here is my css
{
div.menu
{
margin:0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
min-width:100%;
}
div.menu ul
{
margin:0px 0px 0px 0px;
list-style: none;
margin: 0px;
padding: 0px;
min-width:100%;
}
div.menu ul li a
{
background-color:Black;
border: 0px Gray solid;
color: White;
display:table-cell;
padding: 10px 10px;
text-decoration:none;
margin:0px 0px 0px 0px;
}
div.menu li
{
text-align:center;
}
div.menu ul li a:hover
{
background-color: #B5B5B5;
color: Black;
text-decoration: none;
}
div.menu ul li a:active
{
background-color: Gray;
color: Black;
text-decoration: none;
}
div.menu ul li .selected
{
background-color: #646464;
color: Black;
text-decoration: none;
}
}