Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

autostrech div

Status
Not open for further replies.

MJB3K

Programmer
Jul 16, 2004
524
GB
Hi, is there anyway you can make a div stretch 100% height of the div its inside?

e.g.

say i have a div called pagecell and in that i have two divs. one called nav and one called content.

When the content expands downwards, how would you make the nav div stretch down to stay the same height as the content div??

Any ideas??


Regards,

Martin

Computing Help And Info:
 
To answer the question you asked, it's easy: just give the <div> [tt]height:100%[/tt] and it will stretch as required.

However, I'm guessing that you're using either floats or absolute positioning to get these two divs side-by-side. Doing either will take one or both divs (depending on just what you're doing) out of the document flow, meaning that you can't determine height like that.

Take a look at for a way of faking it.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top