SDTT显示了 Answer ,但它与...处于同一水平 Question (所以他们没有关联)。
Answer
Question
原因是你没有添加 Answer 到了 Question ,但是对于父项(在您的代码段中丢失)。
该 div 随着 acceptedAnswer 属性需要是元素的子元素 Question 。如果你的标记不可能(因为 Answer 不应该成为的一部分 summary 元素),你可以使用Microdata s itemref 属性:
div
acceptedAnswer
summary
itemref
<details> <summary aria-controls="panel0" role="tab" itemprop="mainEntity" itemscope itemtype="https://schema.org/Question" itemref="answer"> <p temprop="name">How to beat the boss...spoiler alert !</p> <meta itemprop="answerCount" content="1"/> </summary> <div id="answer" itemprop="acceptedAnswer" itemscope itemtype="https://schema.org/Answer"> <p aria-labelledby="tab0" role="tabpanel" itemprop="text"> Just aim to the red spots near his eyes Keep shooting at these spots until the eyes open, then hit quickly both eyes with your laser beam.</p> </div> </details>
(我补充道 itemref="answer" 到了 Question ,和 id="answer" 到了 Answer 。)
itemref="answer"
id="answer"