Solved

auto expand last div and apply scroll bar

Posted on 2012-12-22
2
343 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

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

Suggested Solutions

Title # Comments Views Activity
ASP.NET Content Page 3 64
Media Queries  not Firing 6 31
Hiding Adsense on Mobile Devices 2 77
Best explanation of following code css 11 40
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
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 …
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…

734 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