慕的地10843
如果您的内部div绝对高(比如说100px),则可以执行以下操作:.outerdiv{
position: relative; //or absolute, or fixed
height: 80%;}.innerdiv{
position: absolute;
width: 100px;
height: 100px;
top: 50%; // it's at 50% but not really centered
margin-top: -50px; // so just move it up by the half of its height :D}我不喜欢这种解决方案,我敢肯定还有很多其他可能性(也许使用表或display: table-cell;)-但这是我想到的第一个...