Is it considered valid to do the following:
<li>stuff</li class="randomlengthclassname">
<li>stuff</li class="shortclassname">
<li>stuff</li class="reallyreallylongarseclassname">
or do the attribute have to be in the opening tag?
No it isn't. You must use attributes in the opening tag.
Running <a>test</a href="tst.html">
in w3c validator results in this error:
name start character invalid: only S separators and TAGC allowed here
Where S separators and TAGC are:
S is "whitespace" separator
[5] s =
SPACE | (32) space
RE | (13) CR
RS | (10) LF
SEPCHAR (9) HT
-- http://xml.coverpages.org/sgmlsyn/sgmlsyn.htm#C6.2.1
TAGC ">"
-- http://www.w3.org/TR/sgml.l
This is not valid, and all attributes must be defined in the opening tag, indeed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With