Solved

auto expand last div and apply scroll bar

Posted on 2012-12-22
2
333 Views
Last Modified: 2013-02-08
I have a design with a outer container div and a number of child divs.

I want to last of the child divs to expand in height to fill in all remaining space whenever the browser resizes. This last child div can have content which is longer and therefore needs a scroll bar.

is this doable with only css, or does javascript have to be applied?
0
Comment
Question by:bhomass
2 Comments
 
LVL 12

Accepted Solution

by:
Chris earned 300 total points
ID: 38716944
More information would have been good here. IE. Does the container div have a set height? Do the child divs have a set height or max height? Are these divs supposed to fill 100% of the screen or can they overflow beyond that?

My understanding without this information is the following:

Parent div is set to 100% height so it always fits the screen.
Child divs have no specified height and will simply expand to fit their content.
Last child div wants to fill any remaining space down to the bottom of the parent div.

If I understand what you're trying to do then there's no way I can think of to manage this with css alone. Javascript is the way forward.
0
 

Author Comment

by:bhomass
ID: 38717350
ok, if so, can you reference some good articles to do this in javascript.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This is a how to build your own CSS3 slideshow and when I say CSS3 I mean just CSS with no javascript in sight! There a few examples online of how to do this but most just show you an example without any explanation, others make it more complicat…
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now