🖍️
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
  • 說明
  • 常見可設定的值
  • 範例
  1. 4. 轉場效果 transition

4.2 屬性 transition-property

Previous4.1 第一個 transitionNext4.3 期間 transition-duration

Last updated 1 year ago

說明

指定某一個或多個 css 屬性,套用轉場效果,例如寬度( width )在 A 狀態是 100px,而 B 狀態是 200px,那轉場就會是寬度從 100px 漸進增加至 200px。

常見可設定的值

  • all:這是預設,會試圖將所有可以轉場效果的 css 屬性,都直接套用。

  • none:任何 css 屬性都不會套用轉場效果。

  • property:這裡是指特定 css 屬性套用轉場效果,例如 width、transform、opacity 等,只要是可以形成數值變化的都可以。

以 3.1 的例子來看,有設定 transition 轉場效果的,有 width、height、border-radius 。

範例

觀察,將:

transition: border-radius 2s, width 2s, height 2s;

改成:

transition: all 2s;