html colspan标签,CSS中的HTML colspan

8843534ef4144c56b46f1262657fa46a.png

月关宝盒

据我所知,css中没有colspan,但column-span在不久的将来会有多列布局,但由于它只是CSS3中的草稿,你可以在这里查看。无论如何,你可以使用div和span像这样的表格式显示做一个解决方法。这将是HTML:

     for the sake of table-less layout. */

  .table { display:table; table-layout:fixed; width:100px; }

  .row { display:table-row; height:10px; }

  .cell { display:table-cell; }

  /* this is where the colspan tricks works. */

  span { width:100%; }

  /* below is for visual recognition test purposes only. */

  .red { background:red; }

  .blue { background:blue; }

  .green { background:green; }

  .black { background:black; }

  /* this is the benefit of using table display, it is able 

     to set the width of it's child object to fill the rest of 

     the parent width as in table */

  .first { width: 20px; }

  .last { width: 30px; }

  .fill { width: 100%; }使用这个技巧的唯一原因是为了获得table-layout行为的好处,如果仅将div和span宽度设置为某个百分比并未满足我们的设计要求,我会使用它。但如果你不需要从这种table-layout行为中受益,那么durilai的回答就足够了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值