Home  >  Article  >  Web Front-end  >  菜鸟有几个关于css 分辨率的问题_html/css_WEB-ITnose

菜鸟有几个关于css 分辨率的问题_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:47:491178browse

本人最近做了一个模板,在自家电脑可以显示正常,但是到了分辨率比较高的机子里面,网页靠左。跪求各位大家有什么可以解决的良方啊?我看别人做得模板,都不出现这样情况!本人实在是想不出来!


回复讨论(解决方案)

margin:0px auto;

看你的页面做多大的,可以通过body限宽
body{width:1000px;margin:0px auto; }

看一下整个的页面宽度,将整个页面居中即可

布局的宽度用百分比,就可以了

一般都是把内容套在一个div中,给这个外层设定一个宽度,例如960px,然后将这个最外层div居中 margin:0 auto;



这里是正式的内容

上面都已经说的很清除了,在body 里面加一个 最外层的div
div 设置一个宽度 比如说1000px  在给div一个外边距 margin:0 auto;
就可以居中了


   

  这个DIV里面是放你的所有内容

   

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn