473,385 Members | 2,015 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,385 software developers and data experts.

Float and margin problems in IE

Ned
I am having trouble with a layout that I am trying to convert from
table based layout to css based layout. I have included source code
for a stripped down version.

The problem is that when the content area is wider that the browser
window, it drops below the left floated div, which will be a
navigation area. This only happens in IE. Firefox, Opera etc all seem
fine with it.

You can see the effect if you open the code below in an 800x600
browser, then shrink the browser window until the green bar disappears
off the right hand side. As soon as it does, the content drops.

Any ideas will be greatly appreciated since I have been fighting with
this one for far too long.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 //EN">
<html lang="en">
<head>
<title>Test Doc</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">

<style media="all" type="text/css">
<!--
#leftbox
{
float:left;
width:200px;
background-color:red;
}
#content
{
background-color:blue;
margin-left:200px;
}

#contentbody
{
height:1%;
background-color:yellow;
}

#testregion
{
background-color:lime;
width:500px;
}
-->
</style>
</head>

<body>
<div id="leftbox">
<p>This is the left box - with a fixed width</p>
<p>This is the left box - with a fixed width</p>
</div>
<div id="content">
<div id="contentbody">
<p>This is the content area</p>
<div id="testregion">This is the test region</div>
<p>This is the content area<br>
This is the content area<br>
This is the content area<br>
This is the content area<br>
This is the content area<br>
This is the content area<br>
This is the content area<br>
This is the content area</p>
</div>
</div>
</body>
</html>
Jul 20 '05 #1
0 1564

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ian Watts | last post by:
I am trying without success to understand what is going on. I am developing a site at http://www.ianwatts.info/edensor/ http://www.ianwatts.info/edensor/edensor.css and I have two problems....
2
by: Rainer Birkenmaier | last post by:
Hi Folks, I have 2 little problems: 1) http://birkenmaier.org/b.php IE 6.0 does something weired here: in the red box the first lines of text have a slight indet (2 or 3 pixels only). This...
2
by: Rainer Birkenmaier | last post by:
Hi again, This float-thing with IE is really killing me ... anyway here two new questions: 1) Check out http://birkenmaier.org/a.php If you display this using IE the margin between the...
3
by: yawnmoth | last post by:
float, among other css attributes, is not working as i'd expect it to on the following webpage: http://www.frostjedi.com/terra/dev/test.html In Internet Explorer, there's a space between the...
4
by: Chris Sharman | last post by:
I've a very simple page (intranet, but moved to http://services.ccagroup.co.uk/dtest.html for you - so the links are all broken). essentially it's just a list of links. I've split it into two...
7
by: alex.krupp | last post by:
I have this webpage where I am getting the dreaded float drop bug in IE. I tried everything in the float drop FAQs online, but nothing can get it working. I have narrowed down the problem though....
2
by: krsgoss | last post by:
I'm trying to do a two column "form" layout based on article here: http://www.alistapart.com/stories/practicalcss/ The idea is to have a label, and a value using definition list markup. I...
3
by: hantechs | last post by:
<html> <body> <p style="width:30%;">text1</p> <p style="float:left;">text2</p> </body> </html> The effect of this html code is : text1 and text2 each is on a line. My question is: Why text2...
3
by: cbjewelz | last post by:
hey I've been suffering from several float problems. I want a Title on the left to be aligned vertically with several links on the right. However with my code the Title is lower than the links....
27
by: GloStix | last post by:
WARNING VIDEO TAKES A WHILE TO LOAD http://screencast.com/t/BWQ6DNtsM I really don't know how to fix this other than putting another div. But I dont' exactly want to do that for every page....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
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
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...

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.