css column-width属性定义及用法
在css中,column-width属性是用来设置多列规划中列的宽度。column-width属性和别的一些多列规划属性不一样,它能够零丁运用。元素只需定义了column-width属性,元素就会构成多列规划,构成的列数取决于column-width属性值。
css column-width属性语法花样
css语法:column-width: auto / length;(例:column-width:100px;)
JavaScript语法:object.style.columnWidth="100px"
column-width属性值申明
auto :列的宽度由别的要素决议
length:自定义列的宽度(如:100px;)
实例
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>css3多列规划之column-width属性设置列的宽度</title> <style type="text/css"> body{background: #ddd;}div{width: 400px;border:1px solid blueviolet;margin-top:10px;column-rule-style:solid;} .a{column-width:80px;} .b{column-width:100px;} .c{column-width:180px;} </style> </head> <body> <div class="a">column-width:80px;演示:列宽设置为80px。这是为了演示效果多写的</div> <div class="b">column-width:100px;演示:列宽设置为100px。这是为了演示效果多写的</div> <div class="c">column-width:180px;演示:列宽设置为180p。这是为了演示效果多写的</div> </body> </html>
运转效果
以上就是css column-width属性怎样用的细致内容,更多请关注ki4网别的相干文章!