0

私が直面している問題については、http://jsfiddle.net/2A3xZ/を参照してください。画像は、最初に描画されたビューポートの右下隅ではなく、スクロール後に右下隅にある必要があります。

使用する

.someclass {
    position: relative;
}

.image {
    position: absolute;
    bottom: 0px;
    right: 0px;
}

そして、互いの内部に div を含めると、何らかの理由で機能しません (画像全体が消えるだけです)。ここで何が欠けていますか?

4

2 に答える 2

1

position: fixed;の代わりに使用されposition: absolute;ます。これを示すフィドルは次のとおりです。http://jsfiddle.net/VbV3P/

編集:OPのコメントの後:

体に塗れるはずですposition: relative;。以下をご覧ください。

HTML:

<body>
<div class="corner">
    <img src="http://wtactics.org/wiki/images/2/2b/Box.png" />
</div>this
<br>is
<br>the
<br>site
<br>content
<br>which
<br>will
<br>cause
<br>the
<br>page
<br>to
<br>scroll
<br>vertically
<br>because
<br>of
<br>its
<br>amount
<br>of
<br>lines.
<br>that
<br>is
<br>expected
<br>behaviour
<br>and
<br>working
<br>as
<br>is
<br>should
<br>be.
<br>however,
<br>the
<br>box
<br>on
<br>the
<br>lower
<br>right
<br>corner
<br>should
<br>be
<br>at
<br>the
<br>current
<br>page's
<br>lowest
<br>corner
<br>depending
<br>the
<br>page's
<br>height,
<br>not
<br>just
<br>in
<br>the
<br>corner
<br>of
<br>the
<br>first
<br>drawn
<br>viewport.
<br>
</body>

CSS:

body {
    position: relative;
}
.corner {
    position: absolute;
    bottom: 0px;
    right: 0px;
}

更新されたフィドルは次のとおりです。http://jsfiddle.net/keW4P/

于 2013-07-21T21:19:45.823 に答える
0

画像が本文の終了タグの直前にあることを確認してください。position: absolute; の値を指定します。右:0; 下:0;

于 2013-07-21T21:33:28.303 に答える