每当我尝试在CSS中做一些看似简单的事情时,它都行不通.
我有一个包含460x160图像的内容div.我想要做的就是将图像放在右下角并将文本环绕在它周围.
<div id="contents">
<img src="..." />
text text text text text text ...
</div>
Run Code Online (Sandbox Code Playgroud)
所以我希望它看起来像:
------------------
| text text text |
| text text text |
| text text -----|
| text text | |
------------------
Run Code Online (Sandbox Code Playgroud)
使用左上角或右上角图像进行操作是蛋糕:
#contents img { float:right; }
------------------
| text text | |
| text text -----|
| text text text |
| text text text |
------------------
Run Code Online (Sandbox Code Playgroud)
现在我该怎么把它推到底部?到目前为止,我提出的最好的是:
#contents img { float:right; margin-top: 90%} // really needs to be 100%-160px
------------------
| text …Run Code Online (Sandbox Code Playgroud)