473,383 Members | 1,880 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Containing div not containing

26
I have a large div and am trying to place 4 divs inside it. The containing div has a set height, as do two of the contained div. The other two do not have set heights.

It works fine unless one of the divs without a set height gets too big. If that happens, I want it to add a scroll bar. Instead, it just cuts off the rest of the content.

Here are my divs:

Containing Div:
Expand|Select|Wrap|Line Numbers
  1. #CenterDivNA {
  2.     width: 580px;
  3.     height: 800px;
  4.     float: left;
  5.     background: #FFFFFF;
  6.     display:block;
  7. }
  8.  
This set-height div is repeated twice:
Expand|Select|Wrap|Line Numbers
  1. #DishClassNA {
  2.     position: relative;
  3.     border-top: 1px solid #666666;
  4.     border-bottom: 1px solid #666666;
  5.     text-align: left;
  6.     height: 20px;
  7. }
  8.  
Here is the (usually) shorter of the two variable height divs:
Expand|Select|Wrap|Line Numbers
  1. TopFrameCenterTable {
  2.     position: relative;
  3.     text-align: left;
  4. }
  5.  
And here is the other one:
Expand|Select|Wrap|Line Numbers
  1. #centerframena{
  2.     position: relative;
  3.     text-align: left;
  4.     overflow:auto;
  5.     padding-left: 15px;
  6.     width: 564px;
  7. }
  8.  
Thanks for all ideas.
Oct 4 '09 #1
5 2803
drhowarddrfine
7,435 Expert 4TB
You can't use the same id name for more than one element.

To get the scroll bars, add 'overflow:scroll' to the parent. (not tested)
Oct 4 '09 #2
liz0001
26
Thanks - You're right on the double ID's, it's actually a class, sorry, I showed it wrong.

Adding "overflow: scroll;" to the parent does add a scroll bar to the whole containing div, all the time. (Adding "overflow: auto;" to the parent adds a scroll bar to the whole containing div when necessary.)

I want a scroll bar on ONLY the last div, the "centerframena" div, ONLY when necessary.
Oct 5 '09 #3
drhowarddrfine
7,435 Expert 4TB
Can you construct a sample page cause I'm too lazy to do it myself.
Oct 5 '09 #4
liz0001
26
Yes, here is an example page:

http://www.dinnerbeat.com/Example.asp

I added colors to the different divs so it is easier to see.
Oct 6 '09 #5
drhowarddrfine
7,435 Expert 4TB
If you add 'overflow:scroll' to CenterDivNA, you get the scroll bars but for the whole center div and not just centerframena but it's close. That's because it's overflowing it's parent. centerframena does not have a similar parent to overflow and that's why just adding overflow:scroll to it does not do what you want.

The solution might lie in creating a wrapper around the actual contents but still giving centerframena the overflow:auto property which will create the scrollbars when needed. This way, when the contents overflow centerframena, you'll get the scroll bars.
Oct 6 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Good Enchiladas | last post by:
While building on a class library for an object model, I get the above error message. The steps to recreate the problem are as follows: 1. Build a RootLevel.dll containing only this code: ...
0
by: Skeeve | last post by:
Hi there, I'm trying to create a containing box (relative position), and within it, I'm trying to line that box with four (top, right, left, bottom) thin boxes that contain a repeated background...
2
by: Skeeve | last post by:
Hi there, I'm trying to create a containing box (relative position), and within it, I'm trying to line that box with four (top, right, left, bottom) thin boxes that contain a repeated background...
10
by: David Fort | last post by:
Hi, I'm upgrading a VB6 app to VB.net and I'm having a problem with a call to a function provided in a DLL. The function takes the address of a structure which it will fill in with values. I...
26
by: Bill Norton | last post by:
If you wrap one division around another like this: <div id="wrapper"> <div id="child">...</div> </div> ....the wrapper division will be considered the containing block of the child division...
4
by: Ivor Somerset | last post by:
Dear CSS community, The code below shows my problem. I have a containing DIV box into which I place floating boxes. As the background-color shows, the size of the containing box is not extended...
1
by: Mohd Al Junaibi | last post by:
Hi all... I've got a group of tables and I wanted to first see which tables contained a fields containing the "Date/Time" data type. And I was successful in doing so...here's the query: (...
17
by: Umesh | last post by:
Can anyone do it? ARMY1987- what say?
3
by: Robertf987 | last post by:
Well, I think I've described what I want to do in the title here. In the database, I have two main tables that contain the main data for the database. One for group expenditures, another for...
0
by: Francesco Pietra | last post by:
I forgot to add that the lines to strip are in present case of the type of the following block HETATM 7007 O WAT 446 27.622 34.356 55.205 1.00 0.00 O HETATM 7008 H1 WAT...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.