theMinimalist: Validation Problem - document type does not allow element "img"

Beitrag lesen

Hallo, danke der Umstieg auf XHTML 1.1 - DTD: hat den Error "behoben".

Nur für's Verständnis. Was ich hier betrieben habe ist ein netter Work Around, aber ich hätte theoretisch auch einfach ein Block Element über das img setzen können und es hätte gepasst?

Das heißt es darf nie ein Image direkt im Body liegen?
Verstehe ich das richtig?

Danke vielmals!
Liebe Grüße

Hi,

[...] bekomme seit dem 1 Error laut dem W3 Validator.
Line 14, Column 123: document type does not allow element "img" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "address", "fieldset", "ins", "del" start-tag.

verwendest du einen Strict-DOCTYPE? In (X)HTML Strict ist es nicht erlaubt, dass Inline-Elemente direkte Kindelemente von body sind; sie brauchen immer mindestens ein Blockelement als Container.

The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, ...

Genau das, was der Validator auch sagt. :-)

So long,
Martin