Reputation: 9363
I have a div tag which has some background color, that adds good look to my page. The div tag contains a button which when clicked generates two textboxes. Everything is working properly but the background is not expanding as and when new elements are added dynamically. I used height:auto in the div tag styling. How do i achieve background expansion as and when content gets added to the page dynamically?
Upvotes: 1
Views: 243
Reputation: 26183
Assuming that you are not using absolute positioning on your child elements, all you have to do is set overflow:hidden
on the parent, this will ensure that the parent expands around all the children inside.
Upvotes: 1