PHP菜鸟博客_共同学习分享PHP技术心得【PHP爱好者】
DIV浮动后父DIV高度自动失效解决方案
2015-11-26 菜鸟站长
  <div style="width:720px;margin:0 auto;background:red;overflow:hidden;">

   <div style="float:left;">

   <img  src="__ROOT__/public/images/1.png" style="width:90px;height:90px;"><br/>

   继续挑选礼品

   </div>

   <div style="float:left;margin-left:60px;">

   <img src="__ROOT__/public/images/2.png"  style="width:90px;height:90px;" ><br/>

   去购物车结算

   </div>


 </div>











总结:其实很简单 只需要在父DIV中加入overflow:auto或overflow: hidden这个属性就搞定。哈哈 是不是很简单呀。

发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容