在不同设置下居中并修复页面更改... [英] Centering and fixing page changes under different setting...

查看:71
本文介绍了在不同设置下居中并修复页面更改...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

第一,我想把我的网站放在中心,这样它就不会向一边倾斜,我想直接上下。
第二个是当另一台计算机上的显示器设置不同时,任何网站都会聚集起来,看起来会分崩离析。如果您理解我的意思,请告诉我具体如何解决此问题。

1st, I want to center my web site so it doesn't lean to one side, I want it straight up and down.
And the second this is when monitor setting are different on another computer ny site bunches up and looks like it going to fall apart. If you understand what I mean please tell me exactly how to fix this.

推荐答案

首先确保在第一行指定了合适的文档类型你的网页。如果不存在,请使用此项:


First be sure there is a suitable document type specified on the first line of your page. Use this one if it is not there:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<! - 在头部的样式部分添加此内容 - >

#mainContainer {
        &NBSP;保证金:0 auto;
}


<!--- 然后使用一个主容器。  - >
< body>
   < div id =" mainContainer">
         *****其他一切都在这里******* 
   < / div>
< / body>

<!-- add this in the style section in the head -->

#mainContainer{
         margin:0 auto;
}



<!---  Then use one master container.  -->
<body>
   <div id="mainContainer">
         *****everything else goes here ******* 
   </div>
</body>


这篇关于在不同设置下居中并修复页面更改...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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