473,769 Members | 2,348 Online
Bytes | Software Development & Data Engineering Community
+ 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 3295
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
3526
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
14976
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
13161
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"> menu2 </div> <div id="menu"> menu3 </div> <div id="menu"> menu4 </div> <span onclick="showOrHide('menu')"> show/hide menu1 </span>
3
3812
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" onclick="__doPostBack('SitesRadioButtonList_3','')" language="javascript" />
3
11432
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 refreshed automatically and I see the changes. But in IE (version 6), I don't see any changes. Do I have do to something more with IE to tell "him" to refresh the DOM.
2
2967
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 background-color to the div, the color won't fill up the entire space I believe it should. The div only has color around the text though it has one line space to the above element. I hope it is clear what I mean:
28
5371
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 </p>s included as well. <P>aaaaaaaaa</p><DIV>bbbbbbbbb</DIV><DIV>cccccccc<P>dddddddd</p></DIV>
2
3206
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 reports no errors in the Error Console, or Firebug, and the <divis resized correctly. Here is the function:
8
10047
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 editor. A fellow member of the PCG has helped me by creating a bit of Javascript to emulate the scrolling and using Google I've now gotten it into a state where it almost passes the W3C Markup Validation Service. However, the one error, Error Line 166,...
0
9586
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
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10043
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
9861
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
8869
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6672
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
5298
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...
0
5446
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2814
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.