开发者

CSS navigation bar: spacing issue

开发者 https://www.devze.com 2023-02-12 08:47 出处:网络
for some unknown reason, my navigation bar is shifted over to the right, on Firefox and also on Chrome. See http://i.stack.imgur.com/ds开发者_运维问答kZy.png

for some unknown reason, my navigation bar is shifted over to the right, on Firefox and also on Chrome. See http://i.stack.imgur.com/ds开发者_运维问答kZy.png

And what's weird is that the issue doesn't arise on jsfiddle. See http://jsfiddle.net/bMAGX/

Any ideas? Thanks.


Are you using a CSS Reset? I'm guessing not. You should consider using one to help with issues like this.

I think you need this CSS to remove the default ul margin/padding:

#topmenu ul {
    margin: 0;
    padding: 0
}


Perhaps because your DOCTYPE is malformed.

<!DOCTYPE html> should be one of the types defined here.


You can add this to top of your CSS:

* { padding: 0; margin: 0;}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号