实现大DIV套小DIV,小DIV随意调整大小,永远居中在大DIV内
日期:2010-06-05作者:樱花下的吻
<div style="display:table; border:1px solid red; width:800px; height:800px;">
<div style="display:table-cell; vertical-align:middle; ">
<div style=" border:1px solid orange; width:200px; height:200px; margin:0 auto;">
</div>
</div>
</div>
<div style="display:table-cell; vertical-align:middle; ">
<div style=" border:1px solid orange; width:200px; height:200px; margin:0 auto;">
</div>
</div>
</div>
评论: 5 | 引用: 0 | 查看次数: -
IE6 IE7无效!
woniu 于 回复
是无效的,樱花刚发这个的时候 我就回复告诉他了
display:table 很用过。
一般常用的就是none block inline inline-block等
一般常用的就是none block inline inline-block等
IE8可以实现
css提供的一系列display属性值,包括display:table,display:table-row,IE下都无效吧..你测试了吗?
发表评论

上一篇
下一篇

文章来自:
Tags:
回复
<div style="width:200px; height:200px; position:absolute; top:50%; left:50%; margin-top:-100px; margin-left:-100px; background:#ccc; ">
<div style=" border:1px solid orange; width:200px; height:200px; margin:0 auto;">
</div>
</div>
</div>
这样不就居中了么!!!