Why is the floated element overlapping the element below and not the other way round?

后端 未结 4 569
失恋的感觉
失恋的感觉 2021-01-17 03:03



        
4条回答
  •  鱼传尺愫
    2021-01-17 03:56

    Lose the float: left; on #p1{}, add a position:relative; to your div{} and position: absolute; top: 0; left: 0; to your #p2{}. Not sure what you're trying to achieve but if you rather keep the float: left; on #p1{} than you need to clear: both; on p{}.

提交回复
热议问题