Make child visible outside an overflow:hidden parent

后端 未结 4 650
独厮守ぢ
独厮守ぢ 2020-11-28 03:02

In CSS the overflow:hidden is set on parent containers in order to allow it to expand with the height of their floating children.

But it also has anot

4条回答
  •  感情败类
    2020-11-28 03:14

    You can use the clearfix to do "layout preserving" the same way overflow: hidden does.

    .clearfix:before,
    .clearfix:after {
        content: ".";    
        display: block;    
        height: 0;    
        overflow: hidden; 
    }
    .clearfix:after { clear: both; }
    .clearfix { zoom: 1; } /* IE < 8 */
    

    add class="clearfix" class to the parent, and remove overflow: hidden;

提交回复
热议问题