PDA

View Full Version : Domanda su errore di validazione W3C html strict 4.01 .


aeroxr1
13-06-2013, 22:30
ciao,
questo è la parte di codice su cui il w3c mi da errore :
<!-- form login -->
<form action="" id="login-form">
<fieldset>
<span class="text">
<input type="text" value="Username">
</span>
<span class="text">
<input type="password" value="Password">
</span>
<input type="submit" id="submit" name="submit" value="Login">
</fieldset>
</form>


Validation Output: 2 Errors

Line 17, Column 22: start tag for "LEGEND" omitted, but its declaration does not permit this
<span class="text">

Line 24, Column 13: end tag for "LEGEND" omitted, but its declaration does not permit this
</fieldset>

You forgot to close a tag, or
you used something inside this tag that was not allowed, and the validator is complaining that the tag should be closed before such content can be allowed.
The next message, "start tag was here" points to the particular instance of the tag in question); the positional indicator points to where the validator expected you to close the tag.

Line 17, Column 4: start tag was here
<span class="text">

qui lo stamp dell'errore , che sopra mi sembra alquanto illeggibile .. XD

http://imageshack.us/photo/my-images/5/erroriw.png/

sto validando in HTML 4.01 STRICT . Dove sbaglio ?


EDIT: trovato l'errore.. non avevo messo volutamente il LEGEND .. perchè devo includerlo per forza ?

wingman87
14-06-2013, 10:56
Come primo figlio di fieldset devi mettere un elemento legend, anche vuoto ma lo devi mettere.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/legend
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/fieldset