2

これは簡単な答えだと思いますが、この効果を達成する方法がわかりません。

基本的に私はこれをやろうとしています: http://demo.smooththemes.com/theone/

このサイトの 1 つでは、スクロールを開始すると、画像は固定されたままになり、コンテンツが上にスクロールします。何か案は?

助けてくれてありがとう。

4

1 に答える 1

1

http://jsfiddle.net/gvMLS/

HTML

 <div id="header">
    </div>
    <div id="content">
        content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>
    </div>

CSS

#header {
position: fixed;
top: 0;
height: 20px;
width: 100%;
background-color: #ff0000;
}
#content {
position: absolute;
top: 20px;
bottom: 20px;
width: 100%;
background-color:#fff;
overflow: auto;
}
于 2013-10-17T02:10:25.637 に答える