css3 column-gap usage
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"> 互聯(lián)網(wǎng)的出現(xiàn),極大的促進了信息的交流,隨著步伐的前進,網(wǎng)站的交互需求越來越多,但是受限于當時的軟硬件條件, 特別是網(wǎng)絡環(huán)境的限制,非常簡單的表單驗證都要花費大量的時間在服務器與客戶端之間進行傳輸, 后來改名為JavaScript。隨著JavaScript在互聯(lián)網(wǎng)上的成功運用,微軟公司也隨之開發(fā)了自己的"JavaScript"名叫JScript, 于是在互聯(lián)網(wǎng)上就出現(xiàn)多種標準的"JavaScript"腳本語言,如果任其發(fā)展下去,那么將會嚴重影響互聯(lián)網(wǎng)發(fā)展, 于是標準化迫在眉睫。最后JavaScript被提交給提交給歐洲計算機制造商協(xié)會(ECMA), 并最終推出了ECMA-262標準,定義了名為ECMAScript的腳本語言,從此以后瀏覽器都將ECMAScript作為JavaScript的實現(xiàn)基礎。 </div> </body> </html>
The above code can set the spacing between columns to 40px.