James Jeffery wrote:
> I have never had to use <img> within the body tag. I was playing about
> with a test case for a client and happened to put <img> directly within
> the body (was for an image on screen with next and prev. links ... a
> gallery).

In HTML 4.x Strict and related specs, the content model of the body
element is "One or more elements that are either in the group %block or
are script elements, and zero or more ins or del elements".

<!ELEMENT BODY O O (%block;|SCRIPT)+ +(INS|DEL) -- document body -->

http://www.w3.org/TR/html4/struct/global.html#h-7.5.1

Since the img element is an inline element, it doesn't meet these
requirements. So you have to place it inside an element which is:

(a) Allowed by the above rule
and
(b) Has a content model which allows inline children (so form, which is
a block element, wouldn't be suitable, since it has a similar content
model to the body element)

The content model of the body element is different in Transitional
doctypes, and img is allowed to be a child of the body element there.



-- 
David Dorward                               <http://dorward.me.uk/>


*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************

Reply via email to