Solved

auto expand last div and apply scroll bar

Posted on 2012-12-22
2
331 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
Comment Utility
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
Comment Utility
ok, if so, can you reference some good articles to do this in javascript.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Creating a CSS block that only applies to printing By default, all of your CSS applies to every possible view of your page - whether on screen, printed, landscape, touch-screen, or whatever.  You can, however, add CSS that only applies under certai…
When applying CSS to your HTML, there are many different ways to select which element(s) the CSS applies to.  Some of these selectors are more commonly known and used than others - Here are the more common ones: #X - Matches an ID of X .X - Matche…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

743 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

13 Experts available now in Live!

Get 1:1 Help Now