这可能是一个简单的问题,但我无法弄清楚.我想使用CSS将图像放在页面的右侧而不是围绕它包装文本.我希望这样:
------------ | img | | | ------------ text text text text text text text ....
如果我做一个浮动:在图像上,我得到这个:
text text text ------------ text text text | img | text text text | | text text text ------------ text text text text text text text ...
我可以轻松地使用表来执行此操作,但我想要纯CSS.
Roh*_*rbs 11
类似的东西应该工作:
<div>
<div style="width: 100%">
<img style="float:right;">
</div>
<div>
text
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
<div>
<img src="img.jpg" style="float:right;" />
<div style="clear:right;">
<!-- text here -->
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
也许?