I would like to know how to code a div so it dynamically resizes to the amount of text that is added in to it’s area.
This is how i would normally create a text area but i want the height:500px; to increase or decrease dependent on the text that is added in via a CMS system.
Well, you could try it and see if it works. The only problem I can think of might be the page content “jumping” a bit as it reshuffles the elements around to accomodate the new dimensions.
I guess it depends on how “fixed” your layout is and how picky you are.
The problem with position:absolute is that it takes the element out of the flow of the document (meaning that other elements don’t know it’s there). Thus, if you have any element placed underneath this div, the abs pos div will expand with more content, but will overlap/underlap the content below it. It’s better to float the div rather than position it absolutely.