元素标签不得作为 a 元素的后代出现

The element label must not appear as a descendant of the a element

一切似乎都工作正常,但是当我验证我的 xml 时,我收到一个错误 The element label must not appear as a descendant of the a element. 类似的问题已经被问到 here,但这对我来说确实很困难。如果我将 labela 中取出,那么只有标签旁边的 icon 可以用作 link,但我想要整个东西。

我当前的代码

<a href="#">
   <span class="glyphicon glyphicon-wrench"></span>
   <label class="iconLabel">Settings</label>
</a>

我尝试将 spanlabel 放入 div,但没有任何改变

label 更改为 span,但将其保留在同一位置,保留 class "iconLabel",这应该有效。

代码:

<a href="#">
   <span class="glyphicon glyphicon-wrench"></span>
   <span class="iconLabel">Settings</span>
</a>