EP04 | 跟著影片做前端切版練習 - CSS Mix Blend Mode Text Scrolling Effects
練習影片
練習重點
- MDN - mix-blend-mode及CSS TRICKs - mix-blend-mode : 元素內容跟背景顏色的混和模式。
參考資料:
《CSS3 mix-blend-mode 》網頁版的Photoshop圖層混合模式
結構
HTML
1 | <body> |
CSS
1 | @import url('https://fonts.googleapis.com/css2?family=Balsamiq+Sans:wght@700&display=swap'); |
小提醒
試了很久才發現,原來使用 mix-blend-mode
時,直接將文字顏色當成文字背景色來看待會比較簡單理解,並且在不同混和模式中,部分顏色是不會有任何變化的(可以再多嘗試看看),像是文字顏色設為黑色,在 mix-blend-mode: difference
時,就不會有變化。
Demo:
See the Pen 前端練習04 - CSS Mix Blend Mode Text Scrolling Effects by Celeste6666 (@celeste6666) on CodePen.