css中position:relative和overflow:hidden的问题

  1. <div style="height:100px; width:100px; background:#CCC; overflow:hidden;">  
  2.     <div style="height:300px; width:90px; background:#999; position:relative;"></div>  
  3. </div>  

解决方案:将父标签的position也设置成relative,代码如下:

 
  1. <div style="height:100px; width:100px; background:#CCC; overflow:hidden; position:relative;">  
  2.     <div style="height:300px; width:90px; background:#999; position:relative;"></div>  
  3. </div>  
posted @ 2014-11-04 17:22  LeftbrainFE  阅读(649)  评论(0)    收藏  举报