CSS到中心页面没有顶部空间 [英] CSS to center page with no top space

查看:49
本文介绍了CSS到中心页面没有顶部空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用CSS来中心我的页面......这很好用,但是我还想消除顶部的小空间,这样我的页面就会与屏幕顶部齐平......都在IE浏览器中和FireFox。我正在使用的CSS代码是:

I''m using CSS to center my pages...which works fine, however I would also like to eliminate the small space at the top so my page is flush with the top of the screen...both in IE and FireFox. The CSS code I''m using is:

展开 | 选择 | Wrap | 行号

推荐答案

嗨torweb,


浏览器通常会在主体和其他元素上添加默认边距和填充。要消除这种情况,请写:

Hi torweb,

Browsers usually add default margins and paddings on the body and other elements. To eliminate this, write:

展开 | 选择 | Wrap | 行号


我的#Container是Div ID。如果我将代码更改为:

My #Container is a Div ID. If I change the code to:

展开 | 选择 | Wrap | 行号


只是感觉指出一些浏览器添加了填充和边距哪里没有。这与你的div无关,因为它已经存在了。添加他提供的代码,它应该可以工作。


谢谢,死亡
As just a feeling pointed out some browsers add padding and margins where there are none. This has nothing to do with your div because it''s already there. Add the code that he provided and it should work.

Thanks, Death


这篇关于CSS到中心页面没有顶部空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆