CSS----实现div两列(左/右)等高

本文介绍了一种使用CSS和HTML实现复杂网页布局的方法,通过浮动元素和清除浮动等技术,实现了左右两栏不同宽度的内容展示。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

<style type="text/css">
 *{ margin:0; padding:0;}

.con{ overflow:hidden; width:980px;}

.con:after{ display:block; visibility:hidden; font-size:0; line-height:0; clear:both; content:"";}

.con .l,.con.r{margin-bottom:-9999px; padding-bottom:9999px;}
.con .l{ width:660px; float:left;}

.con .r{ width:300; float:right;}

</style>

html

<div>

   <div class='con'>

         <div class='l'>llllllllllllllllllllll</div>

         <div class='r'>rrrrrrrrrrrrrrrrrrr</div>

  </div>

</div>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值