我想知道您将如何创建在文本下显示的背景图像的效果。这是一个例子:chevalblanc.com。我想有两个<sections>
,第一个有删减的文本背景图像,第二个部分在背景中有照片或其他东西。我注意到他们使用了 png 来“剪掉”字母并将其用作背景,但是如何创建滚动效果呢?
更新:我发现了如何做到这一点,实际上它很容易。您必须为您的<section>
or提供两个背景图像,<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;
}
对我来说工作得很好。