我有一个父DIV的正方形,里面一个孩子的div它我想设置在另一个固定的宽度和高度
CSS
.parent {
background-color: red;
width: 500px;
height: 300px;
margin: 0 auto;
}
.child {
background-color: yellow;
width: 200px;
height: 100px;
}
现在我想设置的孩子正好在父母的中间没有改变宽度和高度,我该怎么做?谢谢。
那么,基本上没有使用位置:相对,谢谢反正 – Sohail 2012-01-08 22:04:01