Hi can anyone please help me understand why my drop-down div is offset to the right slightly?
Many thanks in advance
Hi can anyone please help me understand why my drop-down div is offset to the right slightly?
Many thanks in advance
It looks like the ul (unordered list) has not been styled; therefore, the default padding-left still remains.
try:
#topnav ul {
list-style:none;
padding:0;
margin:0;
}
See if that helps.
Thanks for the reply. On jsfiddle preview http://jsfiddle.net/KY9gr/3/ it still shows the same gap, any other ideas?
Perhaps you are seeing the 10px of left padding being applied to all list items?
#top-nav li {
float:left;
display:block;
padding:4px 10px 4px [color=red]10px[/color];
}
If so, try this instead:
#top-nav li {
float:left;
display:block;
padding:4px 0px;
}
#top-nav li + li {
padding-left:20px;
}