Reputation: 3615
http://jsfiddle.net/msbyuva/QPQqs/
Hi I have a menu formed using
<ul class="topnav">
<li>@Html.ActionLink("Configuration", "Configuration", "Home")</li>
<li>@Html.ActionLink("Reporting", "Reporting", "Home")
<ul class="subnav">
<li>@Html.ActionLink("Pipeline", "Pipeline", "Pipeline", null, new { target = "_blank", Url = "http://storespipeline/stores/" })</li>
<li>D2C OBI Reports</li>
<li>@Html.ActionLink("Device Utilization", "DeviceUtilization", "DeviceUtilization")</li>
<li>@Html.ActionLink("Display Audit", "DisplayAudit", "DisplayAudit")</li>
<li>@Html.ActionLink("TrueVUE Reports", "TrueVUE", "TrueVUE")</li>
</ul>
</li>
<li>@Html.ActionLink("Admin", "Admin", "Home")</li>
</ul>
CSS:
ul.topnav { list-style: none; padding: 10px; margin: 0; float: left; width: 100%; background: #f6f6f6; font-size: 1em; color: Black; } ul.topnav li { float: left; margin: 0; padding: 0 15px 0 0; position: relative; } ul.topnav li a { padding: 5px 0px 0px 0px; color: black; display: table; text-decoration: none; float: left; } ul.topnav li a:hover { text-decoration: underline; font-weight: bold; }
ul.topnav li span.subhover
{
}
ul.topnav li ul.subnav
{
list-style: none;
position: absolute;
left: 0px;
top: 25px;
background: #f6f6f6;
margin: 0;
padding: 0px 0px 0px 0px;
height: auto;
display: none;
float: left;
min-width: 100px;
width: auto;
}
ul.topnav li ul.subnav li
{
margin: 0px;
padding: 4px 10px 0px 10px;
height: auto;
line-height: 100%;
}
html ul.topnav li ul.subnav li a
{
float: left;
width: 150%;
margin: 0px;
padding: 0px 0px 0px 0px;
text-align: left;
}
html ul.topnav li ul.subnav li a:hover
{
}
</style>
When I click on a link example -- Display Audit -- when the page gets loaded -- the menu link is underneath the page content... that can be seen in the image (the last two links go underneath the page content)..... how can I display the menu link above the page content??
I am using IE7, CSS 2.1
Upvotes: 1
Views: 314
Reputation: 728
You need to use a z-index. For z-index to work both the navigation container and the content container need to have a position of relative, absolute or fixed. For your example I would suggest a relative positioning.
.topnav {
position:relative;
z-index:1000;
}
.yourContentContainer{
position:relative;
z-index:1;
}
Upvotes: 4