OK I have a DIV which is positioned absolutle for source-ordering reasons. I have no other option other than to do this because of the layout of the page floats would be out of the question for this DIV. The problem is this DIV varies in size as it contains some dynamic text which differs in size. So if I wanted other elements to appear underneath this I would need to add a margain-top of ??px whereby the ?? would be the dyanmic height of the DIV, can this be obtained in any way via PHP etc..maybe then I can echo it inside the CSS or via inline CSS statement?
If you're trying to keep something at the bottom and are working with divs, see it this way: <div 1> <div 2> Div1's height changes constantly, pushing Div2 down. Set Div2's top margin to a negative value which will cause it to overlap Div1, thus appearing inside Div1. Hope this helps.
To be honest, I REALLY doubt this statement. Unless you are completely moving a full-width element before another one - in which case your 'source order' no matter how much you THINK helps with SEO, is non-semantic since you'd have gone so far out of flow order your document layout would make no sense. Do you have a example of your layout? We could likely offer suggestions on better ways of doing whatever it is you are doing for layout... Because absolute positioning of a dynamic height element you want to effect flow is ALWAYS a miserable /FAIL/.
You really shouldn't position absolutely a div that has resizing content, it's more headache than anything. In case you still want to, though, javascript is your best answer. You retrieve the height of element x, by using x.clientHeight, Then you can either set a new height or use the result for whatever. Just remember, you'll need to call the javascript functions after the page has loaded, or IE will give you trouble. To learn more about the different height functions and how browsers support them, you can go to to the following website: http://www.quirksmode.org/dom/w3c_cssom.html
OK taking everything into account here I think i could solve it by positioning another element with fixed properties, and leave the other one in the natural flow using floats etc and should be able to achieve the desired effect.
You'll have a much better chance of getting optimal help, if you tell us what you want to accomplish and what you've tried, rather than asking how to do what you've decided is the solution. ds is probably correct; it is highly unlikely that absolute positioning is a desirable approach. cheers, gary