常用的html标签汇总、以及操作过程中的一些bug问题解决方法,以下龙腾飞网络科技-小吴在建站实操中笔记记录,一路走来,一步步学习、总结、整理的一些资料,不用死记硬背,保存使用非常方便,实操过程中遇到了就查询搜索一下,实践出真章,做多了自然就熟悉了:
【定义和用法】
figcaption 标签为 figure 元素定义标题。
figcaption 元素可以放置在 figure 元素的第一个或最后一个子元素的位置。
【实例】
例子 1
使用 figure 元素标记文档中的照片,使用 figcaption 元素定义照片的标题:
<figure> <img src="tulip.jpg" alt="郁金香" style="width:300px"> <figcaption>图 1 - 郁金香,百合科,多年生草本植物。</figcaption></figure>
例子 2
使用 CSS 设置 figure 和 figcaption 的样式:
<html><head><style>figure { border: 1px #cccccc solid; padding: 4px; margin: auto;}figcaption { background-color: black; color: white; font-style: italic; padding: 2px; text-align: center;}</style></head><body><figure> <img src="tulip.jpg" alt="郁金香" style="width:300px"> <figcaption>图 1 - 郁金香,百合科,多年生草本植物。</figcaption></figure></body></html>
【默认的 CSS 设置】
大多数浏览器将使用以下默认值显示 figcaption 元素:
figcaption { display: block;}