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

时间:2019-02-03 01:43:05

标签: html5 validation

我正在尝试为学校做一个项目,但无法弄出“禁止将无花果作为身体的孩子”的错误提示

我尝试使无花果成为<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>

1 个答案:

答案 0 :(得分:2)

您需要使用<figure> HTML标记而不是<fig>。您可以通读the documentation here