Why inspector warning in <div> in <span>?

The following tells me that "<div> is not allowed here".   What is the problem?  The code works fine.

   <span id="main">
        <div id="accordion">
          <!-- Stuff in the accordian -->
        </div>
    </span>

1 comment
Comment actions Permalink

Because it is invalid from standards point of view. div is a block level element while span is inline element.

Check these links for the rest of explanation (I don't see a reason to copy-paste it here):

0

Please sign in to leave a comment.