473,472 Members | 2,181 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to control floating of <div> elements

uranuskid
19 New Member
Hey guys,

I control my webappearance ewith a series of <div> elements. They are supposed to be in line and the main container is supposed to stay min 880px in wdth. However, the left infobox has somehow the bad habit to start under the main <div> element. Also, the min-width is not kicking in, instead the elements get floated to the left and no scroll bar appears.
Expand|Select|Wrap|Line Numbers
  1. #container { 
  2.   font-size: 0.8em;
  3.   width: 900px; 
  4.   min-width: 880px;
  5.   height: 1300px; 
  6.   margin: auto;
  7. }
  8.  
  9. #logo {
  10.   background: url(../pics/logo_01.png) 0 0 no-repeat black;  
  11.   height: 100px; 
  12.   min-width: 880px;
  13.   padding: 0 20px;
  14.   margin: 0; 
  15. }
  16.  
  17. #menue {
  18.     width: 110px;
  19.     margin: 0 0 1.2em; 
  20.     padding: 0;
  21.     border: 0px;
  22.     height: 1200px;
  23. }
  24.  
  25. #info {
  26.    background: rgb(212,206,160);
  27.    width: 150px; 
  28.    height:1000px;
  29.    float: right; 
  30.    padding: 10px 2px 2px 10 px;
  31.    margin: 5px;
  32. }
  33.  
  34. #main {
  35.   margin: 10px 0 0 120px;
  36.   width: 550px;
  37.   background:  0 rgb(245,237,180); 
  38.   padding: 0 10px 10px 20px; 
  39.   line-height: 1.5em; 
  40. }
  41.  
  42.  

I can't figure out what is going wrong there. Any help would be much appreciated!

Cheers,
Frank
Apr 3 '07 #1
5 3278
AricC
1,892 Recognized Expert Top Contributor
Hey guys,

I control my webappearance ewith a series of <div> elements. They are supposed to be in line and the main container is supposed to stay min 880px in wdth. However, the left infobox has somehow the bad habit to start under the main <div> element. Also, the min-width is not kicking in, instead the elements get floated to the left and no scroll bar appears.
Expand|Select|Wrap|Line Numbers
  1. #container { 
  2.   font-size: 0.8em;
  3.   width: 900px; 
  4.   min-width: 880px;
  5.   height: 1300px; 
  6.   margin: auto;
  7. }
  8.  
  9. #logo {
  10.   background: url(../pics/logo_01.png) 0 0 no-repeat black;  
  11.   height: 100px; 
  12.   min-width: 880px;
  13.   padding: 0 20px;
  14.   margin: 0; 
  15. }
  16.  
  17. #menue {
  18.     width: 110px;
  19.     margin: 0 0 1.2em; 
  20.     padding: 0;
  21.     border: 0px;
  22.     height: 1200px;
  23. }
  24.  
  25. #info {
  26.    background: rgb(212,206,160);
  27.    width: 150px; 
  28.    height:1000px;
  29.    float: right; 
  30.    padding: 10px 2px 2px 10 px;
  31.    margin: 5px;
  32. }
  33.  
  34. #main {
  35.   margin: 10px 0 0 120px;
  36.   width: 550px;
  37.   background:  0 rgb(245,237,180); 
  38.   padding: 0 10px 10px 20px; 
  39.   line-height: 1.5em; 
  40. }
  41.  
  42.  

I can't figure out what is going wrong there. Any help would be much appreciated!

Cheers,
Frank
What browser are you testing on? IE doesn't support min-width (I think) also I think a link to your page would be helpful for your first problem.
Apr 3 '07 #2
drhowarddrfine
7,435 Recognized Expert Expert
IE treats min-width as width but allows the container to expand.

Showing us only the css is not helpful.
Apr 3 '07 #3
uranuskid
19 New Member
Hey there,

I solved the issue with the info <div> element starting underneath the main <div>. It was just an issue of aligning them in the respective index.php. For the IE I've got another .css file that gets his bad manners out of the way. However still got to figure out how the main <div> element in the center keeps static there. Unfortunately I can't provide a link as the site is still under construction.

Cheers,
Frank
Apr 4 '07 #4
drhowarddrfine
7,435 Recognized Expert Expert
Then post the html here.
Apr 4 '07 #5
uranuskid
19 New Member
Hey guys,

I found the issue in my internet explorer .css file. I did not define min/max width and height for the IE. Adjusted that and now it works fine. Here is the right code:
Expand|Select|Wrap|Line Numbers
  1. div#container {
  2. width:expression(document.body.clientWidth 
  3.         < 800? "800px": "auto" 
  4.         && 
  5.         document.body.clientWidth 
  6.         > 900? "900px": "auto");
  7.   height:expression(document.body.clientWidth 
  8.         < 1000? "1000px": "auto" 
  9.         && 
  10.         document.body.clientWidth 
  11.         > 1500? "1500px": "auto"); 
  12.     }
  13.  
  14.  
Apr 4 '07 #6

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

Similar topics

2
by: Matthew | last post by:
Hello! What is the best NS/IE compliant way to accomplish this using the least amount of javascript code? <div id="block1"> Group 1 Code </div> <div id="block2"> Group 2 Code </div>
14
by: Charlie T | last post by:
Hello, is there any way to get this to work? myID.innerHTML = "Hello" <DIV id="myID"></DIV> <DIV id="myID"></DIV>
5
by: hibernate | last post by:
I'm somewhat new to javascript/DHTML, and this problem has been plaguing me. I have made an 'array' of <div> tags within my html document like so: <div id="menu"> menu1 </div> <div id="menu">...
3
by: Josef K. | last post by:
Asp.net generates the following html when producing RadioButton lists: <td><input id="RadioButtonList_3" type="radio" name="MyRadioButtonList" value="644"...
3
by: Chantal | last post by:
Hello everybody, I'm relatively new to javascript + DOM so I've a question : I'm removing <div> elements in DOM with javascript. It works perfectly in Firefox and Opera : I mean the DOM is...
2
by: Nikolai Onken | last post by:
Hey, I am trying to learn the exact behavior of CSS and was just placing a couple of <div>'s after each other. Each of the <divhas a <pwithin and some text within the <p> Now when I add a...
28
by: Kent Feiler | last post by:
1. Here's some html from a W3C recommendations page. <P>aaaaaaaaa<DIV>bbbbbbbbb</DIV><DIV>cccccccc<P>dddddddd</DIV> 2.Although I didn't think it would make any difference, I tried it with the...
2
by: paul | last post by:
I have a JS function to change the width of a <divthat works great in Firefox, but not at all in IE7. In IE an error message occurs: Line: 92 Char: 5 Error: Invalid Argument Code: 0 Firefox...
8
prino
by: prino | last post by:
Hi all, I've written code (in REXX) that takes files in legacy languages (PL/I, COBOL, z/OS assembler, etc) and converts them into HTML in a format similar to what's displayed in the z/OS ISPF...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.