I have a CSS nested menu that works perfectly in IE 8 and firefox but in IE7 it produces a small gap between the elements.
this
If you're displaying the elements inline (to create a horizontal menu) the line-breaks between the sibling
s are being converted into a single white-space. You can either comment-out the spaces, or put all the siblings on the same line:
commenting-out:
...- element One
- element Two
- element Three
...
or:
...- element One
- element Two
- element Three
...
(in the latter example note the closing >
of the tags on the next line immediately preceding the next sibling)
or you can use same-line siblings:
...- element One
- element Two
- element Three
...
You could also just use float: left
on the li
elements, which takes them out of the inline document flow. Possibly a negative left-margin to move the li
left to 'cover' the preceding whitespace, though it would likely take trial and error to find a suitable measurement to cover the space without covering the preceding li
element.