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?
Share
Assuming that you are not using absolute positioning on your child elements, all you have to do is set
overflow:hiddenon the parent, this will ensure that the parent expands around all the children inside.