Pertaining to html, how do I make a div container grow with the content instead of manually defining a width and height.
<div id="container"> <div id="logo"> <img src="someimage.png"/> </div> </div>
No matter what the dimensions of logo are, container does not grow with it. :( How would I fix this, or can it be fixed?
Use absolute positioning and instead of setting the offset with top use bottom . With this property you can ensure the position of the bottom edge of your div - any change in size will force the div to expand upwards.
If you don't define width and/or height, the div element grows along with its content. Unless his content is set to absolute! If the content is set to float, you have to set to the container
overflow:hidden
in order to let it grow!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With