🖍️
CSS 排版及動畫效果
  • CSS 排版及動畫效果
  • 1. 簡介
    • 1.1 講者簡介
    • 1.2 課程簡介
    • 1.3 開發工具簡介
  • 2. 棋盤式排版模式 Grid
    • 2.1 基本觀念及術語
    • 2.2 Grid 排版 - Container
    • 2.3 Grid 排版 - Items
  • 3. 多欄排版模式 Column
  • 4. 轉場效果 transition
    • 4.1 第一個 transition
    • 4.2 屬性 transition-property
    • 4.3 期間 transition-duration
    • 4.4 漸變函式 transition-timing-function
    • 4.5 延遲 transition-delay
    • 4.6 transition 縮寫
    • 4.7 練習
  • 5. 動畫效果 animation
    • 5.1 第一個 animation
    • 5.2 關於 keyframes
    • 5.3 同個元素套用多個 animation
    • 5.4 次數 animation-iteration-count
    • 5.5 方向 animation-direction
    • 5.6 延遲 animation-delay
    • 5.7 填滿模式 animation-fill-mode
    • 5.8 播放狀態 animation-play-state
    • 5.9 漸變函式 animation-timing-function
    • 5.10 animation 縮寫
    • 5.11 補充:動畫效果事件(Animation Event)
    • 5.12 練習
  • 6. 作業
  • 7. 第三方動畫效果套件
    • 7.1 Animate.css
    • 7.2 AOS
    • 7.3 CSS Loader
  • 8. 大量練習
  • 9. 其它及參考資料
Powered by GitBook
On this page
  • column-count 設定欄數
  • column-fill 設定如何填滿欄
  • column-gap 設定欄間距
  • column-rule 設定欄之間的直線樣式
  • column-span 跨欄呈現
  • column-width 設定欄寬
  • 練習:瀑布流版型

3. 多欄排版模式 Column

Previous2.3 Grid 排版 - ItemsNext4. 轉場效果 transition

Last updated 1 year ago

column-count 設定欄數

預設值是 auto,可設定欄數:

div.block{
  column-count: 3;
}

例:

column-fill 設定如何填滿欄

  • balance:預設值,各欄的內容會儘可能平均。

  • auto:內容會到達高度之後,才會到下一欄。

例:

column-gap 設定欄間距

預設值是 normal。

例:

column-rule 設定欄之間的直線樣式

跟 border 的屬性值寫法相同。

例:

column-span 跨欄呈現

  • none:預設值。

  • all:設定跨欄呈現。

例:

column-width 設定欄寬

設定了 column-width,就不建議設定 column-count。

例:

練習:瀑布流版型

建立 waterfall.html 檔案,輸入以下:

<div class="column_block">
  
  <div class="column_item">
    1
    <img src="https://dummyimage.com/300x100/ccc/aaa">
  </div>
</div>

然後以 div.column_item 為單位,多複製一些,改變內容數字1以及圖片寬高 300x100。

例: