可是我希望在右div内的内容,在整个右div内都居中,请问如何实现?多谢。
index.html
------------------------------------------------
This is the Header
2列左侧固定右侧自适应宽度+头部+尾部
layout.css
------------------------------------------------
body { font-family:Verdana; font-size:14px; margin:0;}
#container {margin:0 auto; width:100%;}
#header { height:100px; background:#9c6; margin-bottom:5px;}
#mainContent { height:500px; margin-bottom:5px;}
#sidebar { float:left; width:200px; height:500px; background:#cf9;}
#content { margin-left:205px !important; margin-left:202px; height:500px; background:#ffa;}
#footer { height:60px; background:#9c6;}
回复讨论(解决方案)
设置margin-left,margin-right,margin-top,margin-buttom为auto。
http://aliceui.com/vertical-horizoncal/
楼主可以用以下的样式试试,可以自适应浏览器的大小。
JSP Page 右DIV显示的内容
横向的居中 text-align:center 垂直的居中 可以 人为 定义好里面内容的高度然后 margin:auto