【问题标题】:How to make a photoshop style clipping mask with two divs如何用两个 div 制作一个 Photoshop 风格的剪贴蒙版
【发布时间】:2015-05-23 06:25:49
【问题描述】:

我有this 代码,我希望使用 .clip 框为 .ml 创建一个剪贴蒙版效果,这样 50vh 以上的行部分是黑色的,并且当用户滚动时,该行似乎正在转动黑色。

.clip{
    position: fixed;
    z-index: 9999;
    top: 0;
    width: 100%;
    height: 50vh;
    background-color: #414141;
    clip: auto;
}

【问题讨论】:

  • 不确定你到底想在这里问什么......
  • 抱歉,只是想知道如何让黑框在滚动时剪辑到灰线
  • 哦,所以你不想有一个黑盒子,只是一条半黑半灰的线?
  • 我会喜欢这个jsfiddle.net/r8sqt6yc/4 ...在这里甚至喜欢这个jsfiddle.net/r8sqt6yc/5,但我认为这不是你的答案:)

标签: html css mask clipping


【解决方案1】:

也许有背景附件:固定?

.dualbg {
  height:100vh;
  background:linear-gradient(to top, #333,#333) no-repeat rgba(0,0,0,0.3);
  background-size:100% 50%;
  width:3px;
  margin:50vh auto 0;
  background-attachment:fixed;
<div class="dualbg"></div>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-08-16
    • 2017-03-09
    • 1970-01-01
    • 2018-08-10
    • 2011-06-23
    • 1970-01-01
    • 2016-07-07
    • 2012-07-07
    相关资源
    最近更新 更多