<figure>是html5新推出的新元素,用來包含影像及其說明,以便將圖及說明一連結在一起。
※<figure>可以放置一張圖以上,只要它們共用相同的說明即可。
<figcaption> 是用來放置圖片說明的,在推出前並沒有任何原素可以與<img>連結在一起!
※不支援html5的舊瀏覽器會忽略新元素,直接顯示其內容。
原始碼:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<figcaption>
<img src="t013.JPG" />
<figure>自製羊毛氈手機套</figure>
</figcaption>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<figcaption>
<img src="t013.JPG" />
<figure>自製羊毛氈手機套</figure>
</figcaption>
</body>
</html>
輸出畫面:
文章標籤
全站熱搜

figure 才不是這樣嵌套 請不要亂教誤導人好嗎 https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figcaption