Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hey guys,

Im having a hard time on putting the dropdown menu in the center of my page, it's always in the left part. Sorry for asking, im just a beginner. Here's the css code i wrote:

CSS
body {
}
#default {
    margin: auto;
}

#Menu {
    margin: auto;
    padding: 0;

}
    #Menu ul {
        margin: 0;
        padding: 0;
        line-height: 30px;

    }
    #Menu li {
        margin: 0;
        padding: 0;
        list-style: none;
        float:left;
        position: relative;
    top: 3px;
    left: 5px;
    height: 30px;
    width: 151px;
}
    #Menu ul li a {
        text-align: center;
        font-family: 'Lucida Bright';
        text-decoration: none;
        height: 30px;
        width: 177px;
        display: block;
        color: black;

    }

    #Menu ul ul {
        position: absolute;
        visibility: hidden;
        top: 30px;
    }

    #Menu ul li:hover ul {
        visibility: visible;
    }

    ul#Menu  sub li:hover sub1 {
        display: block;
    }

#footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 60px;

}
Posted
Comments
vbmike 29-Sep-13 12:37pm    
I think you may need to post the html of the page also.
Member 10302214 4-Oct-13 2:24am    
Please refer to my comment below sir. Thanks
Ganesh KP 29-Sep-13 14:16pm    
Hi dude, please post your html code too, its very difficult to find the solution to your problem with simple css itself.
Member 10302214 4-Oct-13 2:24am    
Please refer to my comment below sir. Thanks
Member 10302214 4-Oct-13 2:23am    
Sorry guys its been a busy week for me. Sorry for the later reply. Here's the HTML, Please do help :) it'll be much appreciated.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="WebApplication4._default" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link href="StyleSheet1.css" rel="stylesheet" />

Royalties





</head>
<body>
<form id="form1" runat="server">
<div id="default">
<div id="footer" align="center">copyright © 2013</div>
<div id ="Menu">
<ul>
<li>Home</li>
<li>Products
<ul>
<li>Male</li>
<li>Female</li>

</ul>
<li>About Us
<ul>
<li>Developers</li>
<li>Contacts</li>

</ul>
</li>

<li>Sign up / Log in</li>
<li>Discover
<ul>
<li>Link</li>
<li>Link</li>
<li>Link</li>


</ul>
</li>
<li> </li>
</ul>

</div>
</div>

</form>
</body>
</html>

1 solution

Post yout code too, than it would be easy to figure out the problem.
 
Share this answer
 
Comments
ArunRajendra 30-Sep-13 0:21am    
You need to ask in question section not in solution.

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



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