我想知道如何創建背景圖像在文字下顯示的效果。 下面是一個例子:chevalblanc.com。我想象兩個<sections>
,第一個有剪出文本背景圖像,第二個部分有一張照片或背景中的東西。 我注意到他們使用了一個png,他們「剪切」了這些字母並將其用作背景,但是如何創建滾動效果?背景圖像上的透明文字
更新:我發現怎麼做,其實很簡單。你必須給你的<section>
或<div>
提供兩個背景圖像,並在背景「固定」中設置你想要的圖像。
例如:.yoursection { width: xx %; height: xx %; background-image: url(images/backgroundimage.jpg) center center no-repeat fixed, url(images/foregroundimage.jpg) center center no-repeat; }
對我來說工作很好。
能插件你會更清楚一點嗎? –
這是Parallax滾動。你可以在這裏閱讀教程與演示http://webdesign.tutsplus.com/tutorials/complete-websites/using-a-parallax-scrolling-website-using-stellar-js/ – designtocode
其不是文字其固體圖像http: //www.chevalblanc.com/randheli/medias/images/intro/1400/maskintro-en.png – Hushme