css3 column-gap usage
The column-gap attribute is used to specify the distance between columns.
Syntax structure:
column-gap: normal |<length>
Parameter list:
(1).normal:default value,default value This is the current font size.
(2).length: length value, which can be px, em or percentage, etc.
Browser support:
(1). IE10 and IE10 or above browsers support this attribute.
(2). Google Chrome supports this attribute.
(3). Firefox browser supports this attribute.
(4).opera browser supports this attribute.
(5).Safari browser supports this attribute.
Special Note:
Firefox browser needs to add -moz- prefix.
Google and Safari browsers need to add the -webkit- prefix.
Code example:
<!doctype html> <html> <head> <meta charset="utf-8"> <meta name="author" content="http://www.softwhy.com/" /> <title>蚂蚁部落</title> <style type="text/css"> .columns { border: 1px solid green; width: 600px; margin: 20px auto; -webkit-column-count:2; -moz-column-count:2; column-count:2; -webkit-column-gap: 40px; -moz-column-gap: 40px; column-gap: 40px; } </style> </head> <body> <div class="columns"> 互联网的出现,极大的促进了信息的交流,随着步伐的前进,网站的交互需求越来越多,但是受限于当时的软硬件条件, 特别是网络环境的限制,非常简单的表单验证都要花费大量的时间在服务器与客户端之间进行传输, 后来改名为JavaScript。随着JavaScript在互联网上的成功运用,微软公司也随之开发了自己的"JavaScript"名叫JScript, 于是在互联网上就出现多种标准的"JavaScript"脚本语言,如果任其发展下去,那么将会严重影响互联网发展, 于是标准化迫在眉睫。最后JavaScript被提交给提交给欧洲计算机制造商协会(ECMA), 并最终推出了ECMA-262标准,定义了名为ECMAScript的脚本语言,从此以后浏览器都将ECMAScript作为JavaScript的实现基础。 </div> </body> </html>
The above code can set the spacing between columns to 40px.
Next Section