Today, Google is the CSS center layout problem, the result is almost all quoted in the same article.To be in the middle of the IE, just define the attributes of the text-align:center in the element.In Firefox, you need to define a wrapper wrapper.Then specify the margin-left:auto; margin-right:auto; the property to make the block middle of the Firefox.In fact, I myself use the margin:auto; the abbreviation margin attribute to set the center.The margin abbreviation property is a clockwise sequence of four directions in the upper, right, lower, and left clockwise.It's important to note that if you think you want to set the margin-top:auto as long as you want to make the block middle, then you are wrong.In this way, we have to set margin-left自动同时,边距右边:自动;属性可以在中间。但是,你设置边距:0自动,这个方法也可以在中间。
另一个核心的方法是使用左:50% + margin-left: - 375px;结合绝对定位。两中方法如下。
复制代码代码如下所示:
***的一种方法
{体
背景:# 00ff7f;
文本对齐:IE中心alignlayout中心破解; / * * /
}
#包装{
背景:水;
宽度:750px;
边界:自动;边界正确:自动;
}
方法二
{ # wrapper2
位置:绝对;
宽度:750px;
左:50%;
margin-left: - 375px;
背景:橙色;
}


就我个人而言,我一直使用的方法在中间的一个,因为有两块方法缺乏必要的刚度和代码还不是很清楚。如果你缩小法两到一定限度的形式,你会看到整个布局的流动。这就是人们想要的,当然,其他的方法。)2的另一个优点是,它不需要覆盖文本对齐:在其他嵌套的块体单元的中心,因为大部分文字还会加,这可以减少冗余度小到一定的程度,但我认为的好处是可以忽略的。总之,根据自己的喜好,每个人都需要每一个他所需要的是。

另一个是IE的双边缘缺陷和解决方法是添加显示:inline.in事实,这个解析错误错误会影响很多方面。如果你遇到IE在CSS布局的一个例外,你可以尝试添加显示:内联;属性的声明。在某些特定的布局问题显示:显示:组合块和内联相结合,使布局像你所希望的。我曾在一个由无序列表控制图片菜单类似的问题。

尽快,各种浏览器都有CSS bug,但是CSS页面的布局已经发展到现在。虫子让你发疯了。如果有问题,查一下搜索引擎来解决你的大部分问题。如果你平时无所事事,你可以做一些实验,也许更可能在紧急情况下做。