2

私はここで簡単な事実を知りたい:

<div style="position:fixed;height:100%;width:100%;overflow:scroll">
 <div style="position:relative">Large content</div>
</div>

その罰金。再び(オーバーフローは子のスタイル内に配置されます):

<div style="position:fixed;height:100%;width:100%;">
 <div style="position:relative;overflow:scroll">Large content</div>
</div>

スクロールしません。

単純な理由を知りたいだけです。誰か教えてくれませんか?

4

3 に答える 3

1

どうぞ: http://jsfiddle.net/9tKe3/

CSS

.fixed {
    position: fixed;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

.content {
    height: 100%;
    background: red;
    overflow: auto;
}
于 2013-09-11T10:25:50.610 に答える