dablue — 2011-05-05T10:26:27-04:00 — #1
Can anyone please offer me some advice on this.
- I have a <div> - position:relative.
- Inside I have a child <form> which is - position:absolute
Because the <form> is "position:absolute", I have to give the height of the parent "position:relative". Which works fine if the height were to be static:
The problem is I want to account for form errors and I want to have it processed via Ajax. I plan to have each error highlighted below the respective form field and as such the <form> will then appear "break out" of the containing static height div.
I've tried "float:left" on the <form> too and then then placed some test text below it and placed a "clear:left". That almost worked until I checked IE:
Can anyone please offer any suggestions?
Thanks in advance...
ralphm — 2011-05-05T10:58:32-04:00 — #2
That's your problem, really. There's no reason to position the form absolutely, as far as I can see. If you remove position:absolute from the form, it will happily sit inside the div and do its thing, all within the natural flow of the document. Adding extra elements to the form will just mean the containing div expands naturally.
As a general rule, use position:absolute as rarely as you can. It's horrid for general layout purposes.
dablue — 2011-05-05T11:16:05-04:00 — #3
Something as simple as that, I can't believe I messed that up.
Thanks very much Ralph, I appreciate it.