如何修复不允许作为子元素?

问题描述 投票:0回答:1

我想为学校做一个项目,想不通,上面写着“元素图不允许作为身体的孩子”的错误

我试图使图<a>的孩子,但没有奏效。我真的难倒。

<body>
 <h1>&#128038;Gallery</h1>
 <ul>
   <li><a href="index.html">Home</a></li>
   <li><a href="gallery.html">Gallery</a></li>
   <li><a href="resources.html">Resources</a></li>
 </ul>
 <h2>Recent Photos</h2>
 <p>Our members are very active and love to share. Here are three recent sightings by club members. Click a thumbnail to see a larger view.</p>
 <fig>
 <a href="images/bluebird.jpg" target="_blank"><img src="images/bluebird-sm.jpg" alt="Bluebird"></a>
  <figcaption>Bluebird, by Stephan Swallow</figcaption></fig>
 <fig>
 <a href="images/canary.jpg" target="_blank"><img src="images/canary-sm.jpg" alt="Canary"></a>
  <figcaption>Canary, by Cheryl Raven</figcaption>
 </fig>
 <fig>
 <a href="images/robin.jpg" target="_blank"><img src="images/robin-sm.jpg" alt="Robin"></a>
  <figcaption>Robin, by Sandy Byrd</figcaption>
 </fig>
 <p><small>All content &copy; HAWC</small></p>

html5 validation
1个回答
2
投票

您需要使用<figure> HTML标签,而不是<fig>的。你可以通过阅读the documentation here

© www.soinside.com 2019 - 2024. All rights reserved.