Reputation: 1
I was wondering if it is semantically correct or OK to add a headline such as h1, h2, h3, h4 inside an HTML button.
Example
<button type="button">
<h3>Button headline text</h3>
</button>
Upvotes: 0
Views: 238
Reputation: 943564
Semantically? Maybe. You could make arguments either way and it would depend on context.
However, syntactically, it is invalid. HTML does not allow h3
elements to be descendants of button
elements.
Upvotes: 1