I would always have said no, but then I came across this code from Semantic UI (and Fomantic UI), a very popular front-end framework:
<h2 class="ui icon header">
<i class="settings icon"></i>
<div class="content">
Account Settings
<div class="sub header">Manage your account settings and set e-mail preferences.</div>
</div>
</h2>
The code struck me as unusual for two reasons: (1) the <i>
tag has been repurposed as a generic hook for an icon, and (2) there's that nested <div>
sitting right there inside the <h2>
element. I question the semantics of the first, and the validity of the second.
Now I suppose the code works in all major browsers or they wouldn't have used it, but it hardly seems idiomatic. More importantly, is it even valid?
Note: I used the term 'block-level element' in the question (which everyone understands), but as MDN docs point out:
The distinction of block-level vs. inline elements was used in HTML specifications up to 4.01. In HTML5, this binary distinction is replaced with a more complex set of content categories. While the "inline" category roughly corresponds to the category of phrasing content, the "block-level" category doesn't directly correspond to any HTML5 content category, but "block-level" and "inline" elements combined together correspond to the flow content in HTML5.