CSS 列表按三栏分布

html-css09

CSS 列表按三栏分布,第1张

用css 是可以实现的

加一个style='float:left'就能在一行显示了

每次想换行的时候再加一个<div style='clear:both'></div>

就可以换下一行了

css3里有这样的属性 ,不过css3低版本的浏览器有些属性不支持,需要用js写入属性

column-count:列数

或者

column-width:单列宽度 列数

js

object.style.columnCount=3

object.style.columnWidth='100px 3'

用float或者display:inline,单个块需要定宽,而且出来的效果是

123

456

789