Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I wish to add a image to particular menuitem and also I wish to add down a submenu for particular menu item...

From the below menu I wish to add a image for "Home"...I tried it's not working...
And for "About Us" I wish to add a sub dropdown menu like Company, Management, Contact Us

Thanks for the guidances...

My Codes
XML
<div class="red">
            <div id="slatenav">
                <ul>
                    <li id="Home"><a href="#" title="css menus">Home</a></li>
                    <li><a href="#" title="css menus">About Us</a></li>
                    <li><a href="#" title="css menus">Solutions</a></li>
                    <li><a href="#" title="css menus">Services</a></li>
                    <li><a href="#" title="css menus">Customers</a></li>
                    <li><a href="#" title="css menus">Partners</a></li>
                    <li><a href="#" title="css menus">Technical Support</a></li>
                </ul>
            </div>
        </div>


And My Style is below code..
HTML
<style type="text/css" >
.red #slatenav{position:relative;display:block;height:42px;font-size:15px;font-weight:bold;background:transparent url(MyImages/ChkLine.jpg) repeat-x top left;font-family: Calibri; }
.red #slatenav ul{margin:0px;padding:0;list-style-type:none;width:auto;}
.red #slatenav ul li{display:block;float:left;margin:0 1px 0 0; }
.red #slatenav ul li a{display:block;float:left;color:#fff;text-decoration:none;padding:13px 28px 0 28px;height:28px;border: 1px #606060 solid;}
.red #slatenav ul li a:hover,.red #slatenav ul li a.current{color:#fff;background:transparent url(MyImages/GreyBigImg.jpg) no-repeat top center;}
.red #slatenav ul li#home a{
    background: url(MyImages/ISG_Logo_P.jpg) no-repeat top center;??????.?
    width:81px;
}
Posted
Updated 23-Aug-13 22:44pm
v2

1 solution

Let it be useful to someone else like me...
For Adding a MenuItem
CSS
.red #slatenav ul li#Home a{
        background: url(MyImages/ISG_Back_Img.jpg) no-repeat top center;
        width:70px;
    }
    .red #slatenav ul li#Home a:hover{
        background: url(MyImages/ISG_Fore_Img.jpg) no-repeat top center;
    }


For SubMenu to AboutUs MenuItem
XML
<li><a href="#" title="css menus">About Us</a>
                    <ul>
                        <li><a href="#" title="css menus">Company</a></li>
                        <li><a href="#" title="css menus">Management</a></li>
                        <li><a href="#" title="css menus">Mission & Values</a></li>
                        <li><a href="#" title="css menus">Contact Us</a></li>
                    </ul>
                    </li>
 
Share this answer
 

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