CSS で一見単純に見えることをしようとするたびに、うまくいきません。
460x160 の画像を含むコンテンツ div があります。私がしたいのは、画像を右下隅に配置し、テキストをその周りに折り返すことだけです。
<div id="contents">
<img src="..." />
text text text text text text ...
</div>
だから私はそれが次のようになりたい:
------------------
| text text text |
| text text text |
| text text -----|
| text text | |
------------------
左上または右上の画像でそれを行うのは簡単です:
#contents img { float:right; }
------------------
| text text | |
| text text -----|
| text text text |
| text text text |
------------------
では、どうやってそれを底に押し込むのですか?これまでに思いついた最高のものは次のとおりです。
#contents img { float:right; margin-top: 90%} // really needs to be 100%-160px
------------------
| text text |
| text text |
| text text -----|
| text text | |
------------------
この場合、テキストは余白に印刷されないため、画像の上に余白があります。
#contents { position:relative; }
#contents img { position:absolute; right:0; bottom:0; }
-or-
// move the img tag under the text in the html and:
#contents img { float:right; margin-top:-160; }
------------------
| text text text |
| text text text |
| text text -----|
| text text | te |
------------------
この場合、テキストは画像の上または下に印刷されます。
それで...どうすればこれを達成できますか?