So I have this navbar I’m making; I have a Jsfiddle to demonstrate. If you hover over an element, the sublist appears, but if you look carefully, its left edge is just 1 pixel in front of the navbar element that summoned it.
Is there any CSS rule I can add to get rid of this i.e. move the sublist back a pixel? I know it is possible to achieve this with JS (get every navbar element, calculate its distance from the left, take its sublist and give it a left value of one less than that of the element), but for now I’d like to avoid it for now.
I’d prefer a CSS solution if possible, but of course it it isn’t, please tell me and, if you can, provide a JS alternative.
jus add
margin-left: -1px;to your#nav li:hover ulto push it 1 pixel to the left.see it working here.