CSS

列間距column-gap

字號+ 編輯: Snake 修訂: 科学鼠辈 來源: 慕课网 2023-09-12 我要說兩句(0)

column-gap主要用來設置列與列之間的間距。

4、列间距column-gap

column-gap主要用来设置列与列之间的间距。

语法规则如下:

column-gap: normal || <length>

取值说明:

属性值属性值说明
normal默认值,默认值为1em(如果你的 字号是px,,其默认值为你的font-size值)。
<length>此值用来设置列与列之间的距离,其可以使用px、em单位的任何整数值,但不能是负值。


 例如:将内容分三列显列,列与列之间的间距为2em,实现代码为:

column-count: 3;
column-gap: 2em;

style.css代码:

.columns{
paddding:5px;
border:1px solid green;
width:900px;
margin:20px auto;
-webkit-column-count:3;
-moz-column-count:3;
-o-column-count:3;
-ms-column-count:3;
column-count:3;
-webkit-column-gap:3em;
-moz-column-gap:3em;
-o-column-gap:3em;
-ms-column-gap:3em;
column-gap:3em;
}

閲完此文,您的感想如何?
  • 有用

    1

  • 沒用

    1

  • 開心

    1

  • 憤怒

    1

  • 可憐

    0

1.如文章侵犯了您的版權,請發郵件通知本站,該文章將在24小時内刪除;
2.本站標注原創的文章,轉發時煩請注明來源;
3.交流群: 2702237 13835667

相關課文
  • 多個高度相同, 屬性inline-block的div,有的div沒有内容而有的div有内容,有内容的會下沉?

  • 讓整個網頁全侷變成黑白色調的css代碼

  • CSS生成内容

  • CSS3外輪廓屬性

我要說說
網上賓友點評