Re: Absolute positioning images

Bjorn E. Backlund writes:
 > 
 > We're currently implementing the CSS positioning stuff in Intranet Writer (www.xanthus.se) and
 > I have a question regarding the z-order of elements?
 > 
 > We treat all <IMG>s as text level objects, so the file
 > 
 > 	<HTML>
 > 	<IMG>
 > 	</HTML>
 > 
 > is parsed as
 > 
 > 	<HTML>
 > 	<P><IMG></P>
 > 	</HTML>
 > 
 > Assume the following doc:
 > 
 > 	<HTML>
 > 	<IMG id=a style="position: absolute; left: 10; right: 10; z-index: 2">
 > 	<DIV id=b style="position: absolute; left: 10; right: 10; z-index: 1">
 > 		<P>Hello</P>
 > 	</DIV>
 > 	</HTML>
 > 
 > Should (a) be displayed ontop of (b)? 
 > 
 > We treat <IMG>s as text level tags and put them into <P>s 
 > 	=> (a) will be within a <P> 
 > 	=> it won't be on the same level as (b) 
 > 	=> it will be displayed beneath (b)...

Right. The P and the DIV are placed relative to the HTML plane: P is
at level 0 (the default) and the DIV is at level 1, so DIV is in front
of P.

Strictly speaking, if you treat IMG as inline than you are using the
strict version of the HTML 4.0 DTD, in which case the mark-up above is
in error. I assume you only accept it on import, and never generate it
yourself?



Bert
-- 
  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/pub/WWW/People/Bos/                      INRIA/W3C
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 4 93 65 77 71               06902 Sophia Antipolis Cedex, France

Received on Monday, 22 September 1997 12:17:15 UTC