Previous Message
Next Message

divs and positioning ...

Sent by Wildranger222222 on 19 October 2004 09:09


Grady, your points below are exactly mine when it comes to CSS and  
positioning. I use it as a last resort, and very rarely.
 
First, absolute positioning can be controlled by making sure your parents  
use some positioning other than static. Relative is good. And avoiding absolute  
positioned items under the body means your have some flexibility to move  
those nested blocks around relative to the page flow. Aligning your  content with 
the natural page flow, using floats as well, is better, more  reliable, and 
more flexible, I feel. When you use absolute positioning, you do  take content 
out of the natural document flow, and its a mess when you need to  have, say, 
a footer at the bottom, or columns the same length, or control those  content 
blocks in terms of expanding into other blocks, etc. Positioning is a  little 
rigid in those repects. As well, I believe IE has some very poor  support for 
absolute positioned elements inside of other elements and uses the  viewport 
or body instead of the parent in a few cases, if you dont define  it correctly 
in the parent element.
 
The promise of logical, and solid web page layout is with positioning in  the 
future when its more fully supported by all the agents, and as well, has the  
extra features and flexibility it needs to do what floats do. But right now, 
its  lacking something, I feel. Until then, I would work on maximizing how 
your  content naturally flows in the page using floats and inline solutions as 
much as  possible until you find yourself needing that absolute positioned item. 
 I realize that probably goes agaianst how allot of people design with css  
right now.
 
Mitchell
---------------------------------------------------------
Grady,

If you want to position an inner div with respect to a  containing div, then
you want to set the container to position:relative and  then use
position:absolute on the inner div. Then the inner div will then  position
with respect to the container, and properties for the inner div,  like left,
top etc. can be stated in respect to that container, not the  page/viewport. 

As a related comment, I find it's generally better to  rely on the default
positioning of elements rather than "nailing" everything  to the page with
absolute. Between block and inline display, you can  generally get your page
to lay out the way you want it using the default  positioning (static), where
one element just follows the next in the natural  document flow. 

Only resort to absolute position for those elements that  can't be positioned
any other way, and even then use this nested style of  positioning
(absolute-in-relative), as described above, rather then just  positioning
elements absolute without a relative container. This helps keeps  things
simple and fluid (meaning elements can expand as content is added  and
elements that follow will move down to make room for them). In an  absolutely
positioned layout, you often find you have to make code  adjustments as
content  changes.

Charlie

-------------------------
Charles  Wyke-Smith
Principal, BBd
707 552 2225 work
707 552 2226 fax
707 567  BBD1 (2231) cell
[EMAIL-REMOVED]



-----Original  Message-----
From:  [EMAIL-REMOVED]
[EMAIL-REMOVED]]  On Behalf Of Grady Kelly
Sent: Monday, October 18, 2004 2:45 PM
To: CSS  Discuss
Subject: [css-d] divs and positioning ...

Hey  Everyone,

I am trying to position some divs inside another, and it is not  being 
very nice!!!

Here is the url:  http://remedymd.gkdh.com/index_v2.shtml

I had been using absolute  positioning throughout the design, but have 
decided to do it a bit  differently.  In trying to get the thing to 
center, it seems that some  of the divs want to position themselves 
relative to the page rather than the  div that I want it  to.

Thanks!!

Grady
____________________
 
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Possibly related: