Validation Error: Ul Not Allowed As Child Of Element Span
I do not understand why the WC3 validator is flagging this HTML as invalid, the error it reports back is... ''Element ul not allowed as child of element span in this context. (Supp
Solution 1:
<span>
by definition is an inline element (so you use it inside a paragraph, for example), while <ul>
is a block element (which is its own little chunk of space, usually with space before/after it unlike <span>
).
Other people have had the same issue, and end up using <div>
tags instead. See Is it possible to put a list inside a span tag?
Solution 2:
if you style the div as 'display:inline' it should nominally conform to the rule, whilst behaving exactly like a span :)
Solution 3:
If you're using it as a breadcrumb, it's a navigational element, so <nav>
makes the most sense as the container of your <ul>
. Otherwise, give the UL a class of "breadcrumb" <ul class="breadcrumb">
and style it based on its class.
Solution 4:
USE <div>
<div class="bread">
<ul>
<li><a href="./index.php">HOME</a></li>
<li>ABOUT</li>
</ul>
</div>
instead of <span>
<span class="bread">
<ul>
<li><a href="./index.php">HOME</a></li>
<li>ABOUT</li>
</ul>
</span>
Post a Comment for "Validation Error: Ul Not Allowed As Child Of Element Span"