Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Brian Joseph
309 PointsHelp With My Sub Menu Drop Down.
hello everyone i have some sub menus under Blog And Gallery i just don't know why when i hover over the navbar they do not appear on the bottom of the nav bar. can someone please help me here.
2 Answers
Liam Linacre
Courses Plus Student 386 PointsYou have 2 problems.
Firstly your markup is incorrect, this is why you are not experiencing what you expect. Secondly your CSS doesn't quite give the dropdown menu effect. I'll help you with the first but you should try and fix the second on your own. If you need more help i can help with that too.
The markup issue is caused by you closing the list item li too early. When nesting lists as you are you need to wrap the nested ul with the containing li.
Example
<ul>
<li>
Menu Item
<ul>
<li>Sub Menu Item</li>
</ul>
</li>
</ul>
In your code you are closing the list item too early, just after the link, when it should be after the nested list.
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="gallery.html">Gallery</a></li>
<ul>...</ul>
Here is your code fixed, try and see what the difference is
<nav>
<ul>
<li>
<a href="index.html">Home</a>
</li>
<li>
<a href="gallery.html">Gallery</a>
<ul>
<li>
<a href="weddings.html">Weddings</a>
</li>
<li>
<a href="engagements.html">Engagements</a>
</li>
<li>
<a href="newborns.html">Newborns</a>
</li>
<li>
<a href="seniors.html">Seniors</a>
</li>
</ul>
</li>
<li>
<a href="clients.html">Client Access</a>
</li>
<li>
<a href="retouch.html">Retouching Services</a>
<ul>
<li>
<a href="beforeandafter.html">Before And After</a>
</li>
<li>
<a href="rates.html">Rates</a>
</li>
</ul>
</li>
<li>
<a href="blog.html">Blog</a>
<ul>
<li>
<a href="365.html">365 Days</a>
</li>
</ul>
</li>
<li>
<a href="prices.html">Prices</a>
</li>
<li>
<a href="about.html">About</a>
</li>
<li>
<a href="contact.html">Contact</a>
</li>
</ul>
</nav>
Brian Joseph
309 Pointsi figured it out thank you
Brian Joseph
309 PointsBrian Joseph
309 Points