我想知道如何创建背景图像在文字下显示的效果。 下面是一个例子: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