Click here to Skip to main content
16,017,333 members
Please Sign up or sign in to vote.
1.80/5 (2 votes)
See more:
Here i will paste the Css code and asp code. pls add the submenu in this code.
CSS
* { padding: 0; margin: 0; }

body {
 font-family:Times New Roman ;
 font-size: 13px;
 border-color :Black ;
}
#wrapper {
 margin: 0 auto;
 width: 924px;
}
#header {
 width: 922px;
 color: #333;
 padding: 0px;
 border: 1px solid #ccc;
 height: 56px;
 margin: 0px 0px 0px 0px;
 background: #DAC8BF;
}
img
{
    margin : 0;
    height:57px;
    width:923px;

}
h1
{
    font-size :13px;
    text-align :center ;
    padding :20px;
}
#navigation
{



}
#tabs
{ width: 902px;
 color: #444;
 padding: 10px;
 border: 1px solid #ccc;
 margin: 0px 0px 0px 0px;
    float:left;
    background:#D4DAE7;
    font-size:93%;
    line-height:normal;

}
#tabs ul {
    margin:0;
    padding:10px 10px 0 50px;
    list-style:none;
    height:30px;
    }

#tabs li
{
    position:relative ;
    display:inline;
    margin:0;
    padding:0;
    }

#tabs a {
    float:left;
    background:url("img/tableft.gif") no-repeat left top;
    margin:0;
    padding:0 0 0 4px;
    text-decoration:none;
    }

#tabs a span {
    float:left;
    display:block;
    background:url("img/tabright.gif") no-repeat right top;
    padding:5px 15px 4px 6px;
    color:#999;

    }
    #tabs a:hover span
    {
    color:#ECB546;
    }

#tabs a:hover {
    background-position:0% -42px;
    }

#tabs a:hover span {
    background-position:100% -42px;
    }
#cen
{
    width:923px;
    height:480px;

}
#sidebar
{
float:left ;
width:202px;
color:black;
border: 1px solid #ccc;
border-right-style:dashed #ccc;
background-color:#F3F2ED;
height:417px;
}

#content
{
float :right ;
width: 697px;
color: black;
border: 1px solid #ccc;
background:white;
margin: 0px 0px 0px 0px;
padding: 10px;
height:397px;
}

#footer {
 width: 902px;
 border: 1px solid #ccc;
 background-color:#F3F2ED;
 margin: 0px 0px 0px 0px;
 padding: 10px;
 text-align:center;
 color :Black ;
}


ASP:Code

XML
<asp:Content ID="Content1" runat="server"
    contentplaceholderid="ContentPlaceHolder4">

          <li><a href="#"><span>File</span></a></li>
          <li><a href="loan_entry.aspx"><span>Masters</span></a></li>
          <li><a href="#"><span>Reports</span></a></li>
          <li><a href="#"><span>Help</span></a></li>
          <li><a href="#"><span>Contact us</span></a></li>

</asp:Content>
Posted

Hey there,


I think, here is everything you need:

http://css-tricks.com/targetting-menu-elements-submenus-navigation-bar/[^]

Hope it helps.

Azee...
 
Share this answer
 
CSS
* MENU */

#nav {
 background: #e5e5e5;
 float: left;
 margin: 0; padding: 0;
 border: 1px solid white;
 border-bottom: none;
}

#nav li a, #nav li {
 float: left;
}

#nav li {
 list-style: none;
 position: relative;
}

#nav li a {
 padding: 1em 2em;
 text-decoration: none;
 color: white;
 background: #292929;
 background: -moz-linear-gradient(top, black, #3c3c3c 1px, #292929 25px);
 background: -webkit-gradient(linear, left top, left 25, from(black), color-stop(4%, #3c3c3c), to(#292929));
 border-right: 1px solid #3c3c3c;
 border-left: 1px solid #292929;
 border-bottom: 1px solid #232323;
 border-top: 1px solid #545454;
}

#nav li a:hover {
 background: #2a0d65;
 background: -moz-linear-gradient(top, #11032e, #2a0d65);
 background: -webkit-gradient(linear, left top, left bottom, from(#11032e), to(#2a0d65));
}


/* Submenu */

.hasChildren {
    position: absolute;
    width: 5px; height: 5px;
    background: black;
    right : 0;
    bottom: 0;
}

#nav li ul {
 display: none;
 position: absolute;
 left: 0;
 top: 100%;
 padding: 0; margin: 0;
}

#nav li:hover > ul {
 display: block;
}

#nav li ul li, #nav li ul li a {
 float: none;
}

#nav li ul li {
 _display: inline; /* for IE6 */
}

#nav li ul li a {
 width: 150px;
 display: block;
}

/* SUBSUB Menu */

#nav li ul li ul {
 display: none;
}

#nav li ul li:hover ul {
 left: 100%;
 top: 0;
}


#nav li ul



<ul id="nav">
	<li><a href="#">Item 1</a></li>
	<li><a href="#">Item 2</a>
            <ul>
                <li><a href="#">Sub 1</a></li>
                <li><a href="#">Sub 2</a></li>
                <li><a href="#">Sub 3</a></li>
            </ul>
        </li>	
	<li><a href="#">Item 3</a></li>
</ul>
 
Share this answer
 
See this:
<link href="/css_menu.css" type="text/css" rel="Stylesheet"/>
                <div id="menuwrapper">
                        <ul>
                            <li><a href="http://xxx.com/contact.php"">Contact</a></li>
                            <li><a href="http://xxx.com/product_template_list.php">Produc Lines</a>
//SUBMENU OF PRODUCT LINE
                                <ul>
                                    <li><a href="#">Product 1</a></li>
                                    <li><a href="#">Product 2</a></li>
                                    <li><a href="#">Product 3</a></li>
                                </ul>
                            </li>
                            
                            <li ><a href="http://xxx.com">Home</a></li>
                         </ul>
                    </div>


And this is css code for sub menu:
CSS
/**** SECOND LEVEL MENU ****/
/* We make the position to absolute for flyout menu and hidden the ul until the user hover the parent li item */
#menuwrapper ul li ul{
    position:absolute;
    display:none;
}

/* When user has hovered the li item, we show the ul list by applying display:block, note: 25px is the menu height.  */
#menuwrapper ul li:hover ul{
    left:0;
    top:25px;
    display:block;
}

/* As the parent li has float:left property, we overwrite for the submenu (level 2) to float none (normal position)  */
#menuwrapper ul li ul li{
    float:none;
    width:150px;
    background-color:#cae25a;
}

/* We change the background color for the level 2 submenu when hovering the menu */
#menuwrapper ul li:hover ul li:hover{
    background-color:#b1b536;
}

/* We style the color of level 2 links */
#menuwrapper ul li ul li a{
    color:#454444;
    display:inline-block;
    width:120px;
}



Hope it helps!
 
Share this answer
 
v4

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