Search code examples
xhtml-1.0-strict

XHTML strict span inside label is semantic


I'm using XHTML strict. I want to put a SPAN tag inside LABEL tag. Is it correct way?

<label>Username <span>*</span></label><input type="text" .... />

Solution

  • label is an inline element therefore can contain other inline elements like span. So this is correct XHTML.