Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Help with css drop-down menus
Old 01-27-2010, 12:45 PM Help with css drop-down menus
Experienced Talker

Posts: 35
Name: Matthew Cook
Trades: 0
I have the following code for my navigation that is working fine that I want 2 of the list items to have drop down menus:

Code:
<div id="nav">
    
        <ul id="menu">
  <li><a href="#" class="home">Home</a></li>
  <li><a href="#" class="about">About</a></li>
  <li><a href="#" class="projects">Projects</a></li>
  <li><a href="#" class="warranty">Warranty</a></li>
  <li><a href="#" class="resources">Resources</a></li>
   <li><a href="#" class="contact">Contact</a></li>
   <li><a href="#" class="sitemap">Sitemap</a></li>
</ul>
    </div>
    <!-- Nav div ends here -->
here is the css:

Code:
#nav {
    padding: 0px;
    height: 19px;
    width: 960px;
    right: 0px;
    bottom: 0px;
    position: relative;
    margin-top: 10px;
    margin-right: 0px;
    margin-bottom: 20px;
    margin-left: 0px;
}
#menu {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 960px;
  height: 19px;
  position: relative;
}
#menu span {
  display: none;
  position: absolute;
}
#menu a {
  display: block;
  text-indent: -900%;
  position: absolute;
  outline: none;
}
#menu a:hover {
  background-position: left bottom;
}
#menu .home {
    width: 65px;
    height: 19px;
    background-image: url(../images/nav/home.png);
    background-repeat: no-repeat;
    bottom: 0px;
    right: 667px;
}
#menu .about {
    width: 99px;
    height: 19px;
    background-image: url(../images/nav/about.png);
    background-repeat: no-repeat;
    bottom: 0px;
    right: 563px;
}
#menu .projects {
    width: 92px;
    height: 19px;
    background-image: url(../images/nav/projects.png);
    background-repeat: no-repeat;
    bottom: 0px;
    right: 466px;
}
#menu .warranty {
    width: 137px;
    height: 19px;
    background-image: url(../images/nav/warranty.png);
    background-repeat: no-repeat;
    bottom: 0px;
    right: 324px;
}
#menu .resources {
    width: 110px;
    height: 19px;
    background-image: url(../images/nav/resources.png);
    background-repeat: no-repeat;
    bottom: 0px;
    right: 209px;
}
#menu .resources span {
    width: 173px;
    height: 23px;
    left: -180px;
    background-image: url(../images/nav/resources.png);
    background-repeat: no-repeat;
    bottom: 0px;
}

#menu .contact {
    width: 115px;
    height: 19px;
    background-image: url(../images/nav/contact.png);
    background-repeat: no-repeat;
    bottom: 0px;
    right: 89px;
}
#menu .sitemap {
    width: 84px;
    height: 19px;
    background-image: url(../images/nav/sitemap.png);
    background-repeat: no-repeat;
    bottom: 0px;
    right: 0px;
}
Can show me how to make 2 of the list items drop down when you hover the mouse over them.

I am completely lost.

Thanks in advance!
__________________

Please login or register to view this content. Registration is FREE
- Fastest growing Winnipeg website design company
mcook is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-31-2010, 02:43 PM Re: Help with css drop-down menus
wongpk's Avatar
Extreme Talker

Posts: 178
Trades: 0
Which 2 are you talking about? Should be something like this:

HTML Code:
<div id="nav">
        <ul id="menu">
  <li><a href="#" class="home">Home</a></li>
  <li><a href="#" class="about">About</a></li>
  <li><a href="#" class="projects">Projects</a></li>
  <li><a href="#" class="warranty">Warranty</a></li>
  <li><a href="#" class="resources">Resources</a></li>
   <li><a href="#" class="contact">Contact</a></li>
   <li><a href="#" class="sitemap">Sitemap</a>
<!-- Drop Down -->
<ul id="menu-drop">
  <li><a href="#" class="resources">Resources</a></li>
   <li><a href="#" class="contact">Contact</a></li>
</ul>
<!-- Drop Down -->
</li>
</ul>
    </div>
    <!-- Nav div ends here -->

CSS:
#menu li ul {display: none;}
#menu li {position: relative;}
#menu li:hover ul {display: block; position: absolute;}
Should be what you're looking for?
__________________
Regards,
Andrew

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Last edited by chrishirst; 01-31-2010 at 03:20 PM..
wongpk is offline
Reply With Quote
View Public Profile Visit wongpk's homepage!
 
Reply     « Reply to Help with css drop-down menus
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.19276 seconds with 12 queries