gpt4 book ai didi

html - 使用什么 HTML 标签来描述图像?

转载 作者:太空宇宙 更新时间:2023-11-04 15:28:55 24 4
gpt4 key购买 nike

我的典型图片下方会有事件名称(短文本)、描述文本(较长文本)和版权文本(短文本)。我正在寻找最佳标签用例。不要担心与旧浏览器的兼容性。图像将位于图形标签中,因此我们在这里讨论图形标题中的内容。

例子:

-------------------------
- imagine an image here -
-------------------------
Marathon 2013
Some great Marathon 2013 photo of a great runner. This could go on, and on, and on...
and will span multiple lines most of the time.
Courtesy of somesite.com

我目前正在使用引用事件(Marathon 2013)和版权(由 somesite.com 提供)。我正在考虑描述的跨度。

你有什么建议?

最佳答案

        <figure>
<img src="image.jpg" alt="image text">
<figcaption>Some great Marathon 2013 photo of a great runner.
This could go on, and on, and on... and will span multiple lines most of the time.
Courtesy of somesite.com</figcaption>
</figure>

在 figcaption 中你可以使用所有你想要的标签,比如 <a> or <span>

你可以像这样使用 figure 来处理多张图片

        <figure>
<img src="image.jpg" alt="image text">
<img src="image2.jpg" alt="image text">
<img src="image3.jpg" alt="image text">
<figcaption>Some great Marathon 2013 photo of a great runner.
This could go on, and on, and on... and will span multiple lines most of the time.
Courtesy of somesite.com</figcaption>
</figure>

关于html - 使用什么 HTML 标签来描述图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16642317/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com