0

I have an array of div tags that hold images (and captions):

array

1 <div style="padding:5px;border:solid black 1px;width:320"><img src="http://local/photos/3645/thumb/320/tj3645_070206_134731_160020_tn320.JPG" id="tnImg160020_320"></div>
2 <div style="padding:5px;border:solid black 1px;width:490"><img src="http://local/photos/3645/thumb/490/tj3645_060406_025416_151917_tn490.JPG" id="tnImg151917_490"></div>
3 <div style="padding:5px;border:solid black 1px;width:170"><img src="http://local/photos/3645/thumb/170/tj3645_061006_042104_153889_tn170.JPG" id="tnImg153889_170"></div>

Then I have a variable that contains the text of an article. The array of images is generated on the fly from settings in a database. The plan is to allow the users to decide where they'd like to position the images (top, right, left, bottom, middle, etc.)

My questions is, what's the best way to wrap the text around the these images? The whole content is currently wrapped inside a main container div:

<div id="mainDiv"><div>Images1<div><div>Images2<div><div>Images3<div> Text</div>   

Thanks!

4

1 回答 1

2

如果不使用一些 JavaScript,就没有真正的方法。

查看这个JsFiddle,获取一个免费的 JavaScript 示例。我看到的主要问题是文本不会在底部图像之间换行,如果这与您想要做的任何地方接近,请告诉我,我会尝试更多。干杯!

于 2012-06-15T21:57:05.000 回答