Я думал, что в HTML5 вы могли бы блокировать элементы, как дети <a>
элементов, как и понятно из спецификации:Возможно ли figcaption быть дочерним элементом тега <a> в HTML5?
https://www.w3.org/TR/html-markup/a.html#a
Although previous versions of HTML restricted the a element to only containing phrasing content (essentially, what was in previous versions referred to as “inline” content), the a element is now transparent; that is, an instance of the a element is now allowed to also contain flow content (essentially, what was in previous versions referred to as “block” content)—if the parent element of that instance of the a element is an element that is allowed to contain flow content.
Но теперь, когда я проверил мою страницу с HTML валидатор я нашел это сообщение об ошибке:
Error: Element “figcaption” not allowed as child of element “a” in this context. (Suppressing further errors from this subtree.)
код выглядит следующим образом:
<figure class="post">
<a href="#" title="foo">
<figcaption class="articuloInfo ">
<h3>FOO</h3>
<p class="fecha">4/04/2014</p>
<div class="descripcion">
</div>
</figcaption>
<div class="imagen">
<img src="foo.jpg" alt="foo">
</div>
</a>
</figure>
Может кто-нибудь объяснить мне, где ошибка и почему?
'' s не [содержание потока] (http://w3c.github.io/html/dom.html#flow-content). –
Alohci
@ Алохчи, что это значит? – Vandervals