【发布时间】:2019-01-08 20:45:35
【问题描述】:
我有一个简单的布局,由三个全高 div 和一个固定的标题栏组成。
body,html {
padding:0;
margin:0;
}
.header {
position:fixed;
width:100%;
height:50px;
color:white;
margin:20px;
}
.section1 {
background:black;
height:100vh;
display: flex;
align-items: center;
justify-content: center;
color:white;
}
.section2 {
background:white;
height:100vh;
display: flex;
align-items: center;
justify-content: center;
}
.section3 {
background:black;
height:100vh;
display: flex;
align-items: center;
justify-content: center;
color:white;
}
<div class="header">
Header Content
</div>
<div class="wrapper">
<div class="section1">
Section One Content
</div>
<div class="section2">
Section Two Content
</div>
<div class="section3">
Section Three Content
</div>
</div>
我正在尝试在标题栏文本滚动到具有白色背景的部分时将其颜色更改为黑色。
我已经看到了几个 jQuery 插件,它们应该可以实现这一点,但我试图避免任何不必要的脚本。
CSS mix-blend-mode 函数可以让我实现这个吗?有没有人可以举个例子来说明正在实现的类似目标?
【问题讨论】: