求css div表格,css – 按DIV元素布置表格

如果它是真正的表格布局,那么使用html表是合适的.如果它不是真正的表格布局,那么如果要保持HTML不变,这就是CSS中所需的内容:

.small {float:left; clear: both;}

.left {float:left: clear: both;}

.right {float:left;}

“清楚:两者”有点像回车(对于所有有记忆的打字机的人来说都是!)

“float:left”将东西水平放置在彼此旁边而不是框元素的自然垂直堆叠(如div).

对于我自己的table-ish CSS布局,我只使用两个类,“row”和“column”,如下所示:

/* Standard CSS for div tables. By Tom Haws

* Overview:

* 1. a row is a Box element that wants all its children to be

* arranged in a (horizontal) row

* and is itself a new line rather than a continuation of a line.

* 2. a column is a Box element that wants all its children to be

* arranged in a (vertical) column

* and is itself a continuation of a line unless it is

* the first column in a row.

*

* */

/* Any child of a row AND any column class that is anything but first-child

* represents another column continuing the same row

* */

.row>*,.column

{

float: left;

}

/* Every first child of a row and every column that is a first child of any parent

* represents a new row (first column)

* */

.row>*:first-child,.column:first-child

{

clear: both;

float: left;

}

/* All rows and all children of a column are a new line.

* */

.row,.column>*

{

clear: both;

float: left;

}

这是我如何做你的小例子:

随意询问有关CSS标记的细微差别以及它正在做什么的任何后续行动.

总结

如果觉得编程之家网站内容还不错,欢迎将编程之家网站推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值