Re: CSS Positioning question

by Nick <Nick(at)nlnet.co.uk>

 Date:  Sat, 24 Aug 2002 7:18:20 +0000
 To:  "hwg-techniques(at)mail.hwg.org" <hwg-techniques(at)mail.hwg.org>
  todo: View Thread, Original
>In your absolute code you have:
>
>..thispage {position:absolute; ...}
>..photo1   {position:absolute; ...}
>..photo2   {position:absolute; ...}
>..text     {position:absolute; ...}
>
>
><div class="thispage">
>   <div class="photo1">...</div>
>   <div class="photo2">...</div>
>   <p class="text">
>
>There's no end tag for the <p> or the outer <div>, but I don't think 
>that's what's causing the problem. I think that by making all four of 
>these items absolute, you disassociate all of them from each other, so 
>that the two inner divs and the p are no longer "inside" the outer div. 

As I understand it **absolute** positioned elements are positioned 
with reference to there containing elements, as opposed to 
**relative** to there position in the document flow.

Because the outer div is not closed the browser cannot know what 
to position the inner divs absolutely within (ie the document or the outer 
div) I suspect that closing the outer div will fix the problem.

As we see time and again if code is not valid  browsers with valid 
behaviour may differ in there rendering, my personal view is to 
validate first then test as only this way will the results of the test 
reflect the behaviour of all compliant browsers. (Yes I know few 
if any are fully compliant, but that's improving).

It's probably carping to say that the web would be a better place if ALL
browsers displayed a blank page and an error message if there is ANY
error in the code. Imagine how much easier it would be to produce
good code and write good browser software if the browser writers had 
never fallen into the trap of rendering bad code! Now they have to 
continue to render non-valid junk for the sake of backwards compatibility
with all the stuff already out there.

Just my thoughts
Nick

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.