我试图建立自己的网站,并且只知道一些基本的HTML,我在网络上搜索了一下,似乎无法弄清楚如何在图像下方和图像左侧放置文本。
差不多了:
[image] [text]
[text]
几乎就是我的网页布局。目前,我只能浮动图像或将其向左对齐,使文本环绕图像,这是我不想要的。有人能帮我吗?
最佳答案
<div style="width:400px; clear:both;">
<img src="http://media.techworld.com/cmsdata/news/3246520/1998_google.jpg" style="width:300px; float:left;" />
<div style="width:100px; float:left;">
text beside image
</div>
</div>
<div style="clear:both;">
text beneath image
</div>
http://jsfiddle.net/Tw2v7/