473,769 Members | 5,072 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Containing div not containing

26 New Member
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 2817
drhowarddrfine
7,435 Recognized Expert Expert
You can't use the same id name for more than one element.

To get the scroll bars, add 'overflow:scrol l' to the parent. (not tested)
Oct 4 '09 #2
liz0001
26 New Member
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 "centerfram ena" div, ONLY when necessary.
Oct 5 '09 #3
drhowarddrfine
7,435 Recognized Expert Expert
Can you construct a sample page cause I'm too lazy to do it myself.
Oct 5 '09 #4
liz0001
26 New Member
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 Recognized Expert Expert
If you add 'overflow:scrol l' 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
1588
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: Public Class Root End Class
0
1542
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 image, thus creating a kind of fancy border. What would be the best practice to do that? I thought that if the containor box was relative and the contained boxes were absolute, that would work because the absolute boxes would be measured...
2
4552
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 image, thus creating a kind of fancy border. What would be the best practice to do that? I thought that if the containor box was relative and the contained boxes were absolute, that would work because the absolute boxes would be measured...
10
4995
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 get an error: ---------------- An unhandled exception of type 'System.NullReferenceException' occured in
26
2049
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 in all cases except where 1. the positioning of the wrapper is static and 2. the positioning of the child is absolute.
4
2917
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 by the inner floating boxes. Without the float, it works as expected. Why? What is it I am missing here about the CSS box model? Thanks in advance for your help.
1
1663
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: ( select a.name tablename, b.name colname from sysobjects a, syscolumns b
17
2902
by: Umesh | last post by:
Can anyone do it? ARMY1987- what say?
3
3194
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 application details. I have a query for each of them to copy all the contents of the table into a new table, then delete all the data from the main table. I need to do this becasue once a year the data needs to be removed, ready for putting in new data. I...
0
2088
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 446 27.436 34.037 56.145 1.00 0.00 H HETATM 7009 H2 WAT 446 27.049 33.827 54.563 1.00 0.00 H occurring in a 300MB file. In present case each three-lines block is followed by line renumbering (7007,
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10214
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10048
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6674
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5304
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3963
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3563
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.