0

嗨,我是 html 新手,不知道任何 php 或 javascript。我有一个简单的 html 网页,中间有一张图片。我想要它,以便当您单击图片时出现描述图片的文字,但无需转到新网页。这是否可以在不使用 javascript 或 php 的情况下仅在 html 上执行,如果可以,它是如何完成的?谢谢

4

2 回答 2

0

details可以用和summaryHTML5 元素做类似的事情。

见这个小提琴(仅适用于 Chrome/Safari/Opera)

<details>
    <summary><img src="image-source"> Click here for more information</summary>
    <p>more information</p>
</details>

由于缺乏浏览器支持,我不建议使用它们。参见caniuse.com - 摘要

于 2013-08-07T09:35:57.477 回答
0

您也可以使用 HTML 标题标签。您想要显示的文本将显示在所有浏览器的 mouseOver 上。

<img src="xxxxxx" title="This is the title" />

看看小提琴

于 2013-08-07T09:44:06.277 回答