【发布时间】:2017-11-04 15:12:28
【问题描述】:
我发现这篇帖子CSS-only Acrylic Material from Fluent Design System 很棒,但它有一个大问题。
当我尝试使用多个 background image 时,它不再起作用,因为需要以下代码:
body, .acrylic::before {
background: url("img1.jpg") center/cover;
background-attachment: fixed;
}
但我想为页面部分使用不同的背景图像:
body {
background: #FFF;
}
.hero {
background-image: url(img1.jpg);
}
.about {
background-image: url(img2.jpg);
}
我需要能够在页面的任何位置使用亚克力材质效果,如下所示:
<body>
<div class="hero">
<h1>I´m a hero</h1>
<a href="#section">Scroll down link</a>
</div>
<div id=section class="about"><p>Section has different background image <span class="acrylic">but this content is on the Acrylic Fluent Design surface<span/></p><div/>
</body>
所以我需要亚克力表面作为通用设计组件,不受原帖的限制。如果有人知道该怎么做,我将非常感谢任何帮助。 谢谢(对不起,我写得不好——我不是母语人士,所以我希望你能理解我写的一切:))
【问题讨论】:
标签: html css fluent-design