Click here to Skip to main content
14,934,046 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am developing a website, and having a problem in navigation on it which is not displayed on the Webpage infact on a Master Page.
ASP.NET
<asp:Menu ID="Menu1" runat="server" Orientation="Horizontal" Height="25px" BackColor="#F7F6F3" DynamicHorizontalOffset="2" Font-Names="Verdana" Font-Size="0.8em" ForeColor="#7C6F57" StaticSubMenuIndent="10px">
    <DynamicHoverStyle BackColor="#7C6F57" ForeColor="White" />
    <DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
    <DynamicMenuStyle BackColor="#F7F6F3" />
    <DynamicSelectedStyle BackColor="#5D7B9D" />
    <Items>
        <asp:MenuItem Text="Home" Value="Home"></asp:MenuItem>
        <asp:MenuItem Text="Events" Value="Events">
            <asp:MenuItem Text="Muharram-ul-Haram" Value="Muharram-ul-Haram"></asp:MenuItem>
            <asp:MenuItem Text="Safar-ul-Muzaffar" Value="Safar-ul-Muzaffar"></asp:MenuItem>
            <asp:MenuItem Text="Rabi-ul-Awwal" Value="Rabi-ul-Awwal"></asp:MenuItem>
            <asp:MenuItem Text="Rabi-us-Sani" Value="Rabi-us-Sani"></asp:MenuItem>
            <asp:MenuItem Text="Jamadi-al-Awwal" Value="Jamadi-al-Awwal"></asp:MenuItem>
            <asp:MenuItem Text="Jamadi-us-Sani" Value="Jamadi-us-Sani"></asp:MenuItem>
            <asp:MenuItem Text="Rajab-al-Murajjab" Value="Rajab-al-Murajjab"></asp:MenuItem>
            <asp:MenuItem Text="Shaban-al-Moazzam" Value="Shaban-al-Moazzam"></asp:MenuItem>
            <asp:MenuItem Text="Ramzan-ul-Mubarak" Value="Ramzan-ul-Mubarak"></asp:MenuItem>
            <asp:MenuItem Text="Shawwal-al-Mukarram" Value="Shawwal-al-Mukarram"></asp:MenuItem>
            <asp:MenuItem Text="ZeeQaadah" Value="ZeeQaadah"></asp:MenuItem>
            <asp:MenuItem Text="ZilHajjah" Value="ZilHajjah"></asp:MenuItem>
        </asp:MenuItem>
        <asp:MenuItem Text="Calender" Value="Calender"></asp:MenuItem>
        <asp:MenuItem Text="Mobile Apps" Value="Mobile Apps"></asp:MenuItem>
    </Items>
    <StaticHoverStyle BackColor="#7C6F57" ForeColor="White" />
    <StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
    <StaticSelectedStyle BackColor="#5D7B9D" />
            </asp:Menu>


On visual studio designer, it is displayed, but in the browser is not. however when i hover mouse on it, the submenu is displayed but not the maain menu.

Here is the snapshot,
https://www.dropbox.com/s/j5i27lj914015qj/Untitled.png?dl=0[^]
Posted
Updated 29-Aug-14 6:58am
v2

1 solution

Your menu needs to have a higher z-index than the rest of the page content. From your screenshot it appears the page title "Welcome to Shia Islamic Event Popper Website" has a higher z-index than your menu.

z-index reference
   
v2
Comments
Muhammad Taqi Hassan Bukhari 30-Aug-14 12:20pm
   
I have tried your solution: have a look at it now. https://www.dropbox.com/s/yllgpb5u5twmoku/Shah-e-Waala_Home_Page_-_2014-08-30_21.12.42.png?dl=0
But still facing problem. because the navigation is not in the center of the div vertically.
Here is the css code for that div.
.Menu-bar-in-the-header{
width:100%; float:left;
height:30px;
line-height:normal; z-index:-5;
}
SteveyJDay 30-Aug-14 14:28pm
   
Try setting line-height to 30px the same as the height. This is a trick to center content vertically. It only works when you have one row of content in the div. Also if your page is construct correctly there should be no need for the float:left. Another note by default div tags are always width:100% so adding width:100% in your CSS is redundant.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900