...

View Full Version : Div help.



syco__
08-28-2011, 11:43 AM
Is there away to give one div height the value of another div area.
say


height: #div2;

so div area 1 is given the same height as div 2?

webdev1958
08-28-2011, 11:48 AM
How you do it depends on the relationship between the 2 divs.

You could do just


#div1, #div2 {
height: 100px;
}

or if div2 is a child of div1 and the height of div1 is dynamic then you could use the inherit value for the div2 height.

Post the html you have.

syco__
08-28-2011, 12:00 PM
yeah but i want the parent to have the same height as the child is that possible? but it to be dynamic and change according to each page and what is in that childs div.

vikram1vicky
08-28-2011, 01:06 PM
No need to define height for parent DIV.. it ll automatically stretched according to its child DIV...

If child div is floated element.. then you need to add overflow:auto property to parent DIV....

:)

syco__
08-28-2011, 01:12 PM
Thanks its still not working 100% the way i want but i can work with it thanks for your help, your a good friend.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum