Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

auto expand last div and apply scroll bar

Posted on 2012-12-22
2
Medium Priority
?
352 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 1200 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this Micro Tutorial viewers will learn how to create a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
Suggested Courses

926 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