I am making a horizontal menu system for a website. So, I have looked at examples of css menu's before I attempted my own.

So, right now the menu is working top level-wise up until it spots my UL tag inside of my LI. My problem is that the colors is working, but it is not lining up to the top level. So in the screenshot I attached, Jobs should be under Candidates. Instead, it's gone to the next line.

How do I fix the position problem for my nested ul?

<ul class="nav">
<li><a href="">Home</a></li>
<li><a href="">Active Candidates</a></li>
<li><a href="">Candidates</a>
<ul><li><a href="">Jobs<a href=""></li></ul>
<li><a href="">Contact Us</a></li>
ul.nav, ul.nav ul
	list-style: none;
	margin: 0;
	padding: 0;

ul.nav li a, ul.nav ul li a

ul.nav li

ul.nav li a:hover, ul.nav ul li a:hover


Recommended Answers

All 2 Replies

You need to give your sub-ul a class and then right the formatting for that class in your style sheet to position it correctly.

This simple tutorial might help you.


or this one


google will give you millions of examples to study and work from

You don't need to add a class to the sub-ul.

At its simplest, you can just copy the entire code from either tutorial, then re-style to suit your site. THEN try to understand the code.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.