Killersites Community: height problem - Killersites Community

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

height problem

#1 User is offline   dianikol85 

  • PipPipPipPip
  • Group: Member
  • Posts: 126
  • Joined: 09-April 10

Posted 04 April 2011 - 06:56 AM

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
0

#2 User is offline   Andrea 

  • View gallery
  • Group: Moderators
  • Posts: 5,498
  • Joined: 19-December 08
  • LocationSan Antonio, TX

Posted 04 April 2011 - 07:00 AM

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.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users