Hi,
- Ist der W3C-Validator nicht (ausreichend) korrekt, wenn er mir meine "<br />" als HTML 4.01 Transitional durchgehen lässt?
Das liegt daran, daß für HTML SHORT_TAG YES gesetzt ist ==> der / schließt das Tag, das > ist freier Text.
An der Stelle, an der br-Elemente erlaubt sind, ist auch freier Text erlaubt.
Mach das gleiche mit einem meta-Element, und es gibt Probleme - im head ist kein freier Text erlaubt ==> der freie Text (das >) muß im body sein.
Da das schließende Tag von head und das öffnende tag von body optional sind, wird implizit der body geöffnet.
Kommt dann noch irgendein tag, das nur zum head gehören kann oder ein öffnendes body-tag, kommt die Fehlermeldung.
http://www.w3.org/TR/html401/struct/text.html#edef-BR sagt menschenlesbar: "Start tag: required, End tag: forbidden", aber maschinenlesbar: "<!ELEMENT BR - O [...]". Es entspricht allerdings nicht meiner Erfahrung, dass dieses O dann tatsächlich als optional interpretiert wird.
Du hast den entscheidenden Teil der Element-Definition weggekürzt, nämlich das EMPTY:
<!ELEMENT BR - O EMPTY>
http://www.w3.org/TR/html401/intro/sgmltut.html#h-3.3.3 sagt:
The hyphen and the following "O" indicate that the end tag can be omitted, but together with the content model "EMPTY", this is strengthened to the rule that the end tag must be omitted.
cu,
Andreas
Warum nennt sich Andreas hier MudGuard?
Schreinerei Waechter
Fachfragen per E-Mail halte ich für unverschämt und werde entsprechende E-Mails nicht beantworten. Für Fachfragen ist das Forum da.