如何在选框幻灯片放映中的每个图像下面写文字

时间:2014-03-25 13:15:18

标签: html css slideshow marquee

我想在这个选框幻灯片放映的每个图像下面写三行文字。

Fiddle

<marquee bgcolor="#FFFFFF" height="5%" width="600px" direction="left" scrolldelay="120" align="middle" >
    <img src="http://static.ddmcdn.com/gif/storymaker-best-hubble-space-telescope-images-20092-514x268.jpg" width="120px" height="120px" border="5"/>
    <img src="http://www.pictures-of-cats.org/images/Pixiebob-cat-list-of-cat-breeds-pictures-of-cats.jpg" width="120px" height="120px" border="5"/>
    <img src="http://www.pictures-of-cats.org/images/ragdoll-cat-small-pictures-of-cats.jpg" height="120px" width="120px" border="5"/>
    <img src="http://www.pictures-of-cats.org/images/ragdoll-cat-small-pictures-of-cats.jpg" height="120px" width="120px" border="5" />
    <img src="http://www.pictures-of-cats.org/images/Pixiebob-cat-list-of-cat-breeds-pictures-of-cats.jpg" height="120px" width="120px" border="5" />
    <img src="http://www.pictures-of-cats.org/images/Pixiebob-cat-list-of-cat-breeds-pictures-of-cats.jpg" height="120px" width="120px" border="5" />
    <img src="http://static.ddmcdn.com/gif/storymaker-best-hubble-space-telescope-images-20092-514x268.jpg" height="120px" width="120px" border="5"/>
    <img src="Animal68.gif" height="120px" width="120px" border="5" />
    <img src="http://static.ddmcdn.com/gif/storymaker-best-hubble-space-telescope-images-20092-514x268.jpg" height="120px" width="120px" border="5" />
    <img src="http://www.pictures-of-cats.org/images/Pixiebob-cat-list-of-cat-breeds-pictures-of-cats.jpg" height="120px" width="120px" border="5" />
</marquee>

2 个答案:

答案 0 :(得分:2)

这是你在找什么?:

<强> JSFIDDLE

用[{1}}包装img标签然后将其设置为:div(类 item 它是您喜欢的任何内容,我刚才在这里使用,因为是FIDDLE上使用的类

答案 1 :(得分:0)

避免将<marquee>用于图片!但是如果你需要,那么你可以这样使用它:Fiddle

<marquee bgcolor="#FFFFFF" height="5%" width="600px" direction="left" scrolldelay="120" align="middle" >
    <div style="width:120px; display: inline-block">                    
        <img src="http://static.ddmcdn.com/gif/storymaker-best-hubble-space-telescope-images-20092-514x268.jpg" width="120px" height="120px" border="5"/>
        <div>Text</div>
    </div>
    <div style="width:120px; display: inline-block">                    
        <img src="http://static.ddmcdn.com/gif/storymaker-best-hubble-space-telescope-images-20092-514x268.jpg" width="120px" height="120px" border="5"/>
        <div>Text</div>
    </div>
</marquee>