offset top scroll

Out of context: Reply #11

  • Started
  • Last post
  • 14 Responses
  • crillix0

    What about using the image twice, something like...
    <style>
    html {}
    body {
    margin: 0; padding: 100px 0 0 0;
    }
    .header {
    position: fixed;
    top:0;
    width:100%; height:100px;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    }
    .header.clip { z-index: 999; }
    .content {
    background-color: #fff;
    width:500px; height:5000px;
    margin:auto;
    }
    .bgimg { background:url(http://goo.gl/v8T... 0 0 no-repeat #f4f4f4; background-attachment: fixed; }
    </style>
    <body class="bgimg">
    <div class="header"></div>
    <div class="header clip bgimg"></div>
    <div class="content">
    Weee
    </div>
    </body>

View thread