I think this is because I have a gap between the nested li's and the top level li's
Between the UL
nested into the top-level LI
, to be more precise, but yes, that is of course the problem. So to fix it, you will have to close that gap.
One simple way of doing that in this specific case could be to just give the top-level LI
a border-bottom:10px solid transparent
. That way, your LI
stretch further down until where the absolutely positioned UL
start, so there is no gap any more – and since the border is transparent, there is no visual effect ;-)
http://jsfiddle.net/dS6G7/3/
And that selector
#ddmenu li a:hover ul { … }
doesn’t make any sense btw., because you don’t have your UL
nested into those A
elements.