dianikol85 Posted April 4, 2011 Report Share Posted April 4, 2011 Hi to all. This is the situation. I have this piece of hmtl <div id='wrap'> <div class='image'> <img src='images/1.jpg' /> </div> <div class='image'> <img src='images/2.jpg' /> </div> <div class='image'> <img src='images/3.jpg' /> </div> </div> what i need is that the height of the div#wrap must has the height of the inner div.image. I can't give a fixed value to the height because the div.image is going to have different height from time to time. So i need the div#wrap's height to asjust dynamically according to the div.image. For example: The images i will display today they all have height:100px; Tomorrow they will have 200px; and so on. How i should do it?? Tanks Quote Link to comment Share on other sites More sharing options...
Andrea Posted April 4, 2011 Report Share Posted April 4, 2011 For starters, you really don't need the div class="image" divisions. If you are applying some css to the image, you can do so via #div img. Then, your wrap division will automatically be as big as its content, so setting a height is not even an issue. If you do have some space in there you don't want, make sure padding of the wrap div and that and the margins of the images inside are zero. That should do it, I think. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.