473,239 Members | 1,573 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,239 software developers and data experts.

Div left margin getting double size on IE6. Why?

Hi this is the html to generate the behavior:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<body style="margin: 0px; padding: 0px;">
<div style="margin-left: 10px; float: left;">
<div id="test" style="background-color: red;">
test
</div>
</div>
</body>
</html>

I used margin-left: 10px but IE6 show a margin with 20px.

If I remove the style "float: left;" this way:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<body style="margin: 0px; padding: 0px;">
<div style="margin-left: 10px;">
<div id="test" style="background-color: red;">
test
</div>
</div>
</body>
</html>

the IE6 show the right margin.

Please help-me!!!
or my boss will kill me ;)
Jun 27 '08 #1
5 3520
On 12 May, 18:10, Neviton <nevito...@gmail.comwrote:
Hi this is the html to generate the behavior:
Don't post fragments or complete pages, post URLs to publically
accessible examples.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Why use XHTML? For XHTML to even begin to be a good idea, you must
know why you're doing it, appreciate why you shouldn't do it,
understand what precise benefit using it will give you for this
precise example, then show that there actually is such a benefit.
There almost never is such a benefit.

Why use Transitional? As for XHTML, maybe even more so.

Use HTML 4.01 Strict instead, all the time, unless you can argue a
good case for it with the audience here.

<html xmlns="http://www.w3.org/1999/xhtml" >
<body style="margin: 0px; padding: 0px;">
Where's the <headand <titleelements?

This code is invalid. That means three or four things at least:

* You haven't read the newsgroup, or understood the importance of
using valid markup.
** You don't appreciate that posting invalid code here is just going
to generate a "Post valid code" response.

* Invalid code makes IE go bananas. A basic starting point for keeping
it under control is to only feed it valid code.

* You don't validate your code as a matter of course. _Anything_ could
be hiding in there.

* We don't have time to fix valid code. We certainly don't have time
to mess with invalid stuff. Do the basics yourself first.

I used margin-left: 10px (and float:left;) but IE6 show a margin with 20px.
Go and read http://brainjar.com/css/positioning/ on the meaning and
effects of "width" and "margin" when applied to floated elements. You
need to understand what float means first of all before using it. In
particular the stuff about floated elements being taken out of the
normal flow of rendered elements.

Please help-me!!!
or my boss will kill me ;)
We're still thinking about it.
Jun 27 '08 #2
On May 12, 6:10*pm, Neviton <nevito...@gmail.comwrote:
Hi this is the html to generate the behavior:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www..w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<body style="margin: 0px; padding: 0px;">
* * * * <div style="margin-left: 10px; float: left;">
* * * * * * * * <div id="test" style="background-color: red;">
* * * * * * * * * * * * test
* * * * * * * * </div>
* * * * </div>
</body>
</html>

I used margin-left: 10px but IE6 show a margin with 20px.
Known bug with IE6. If you float to one side it doubles the margin on
the same of the floated element.

See http://www.positioniseverything.net/...ed-margin.html
Steve


Jun 27 '08 #3
Man whats your problem?
Are you angry?

If I have asked for help is cause I dont know how to do what I need.

Could you undestand it?

I dont put head e title element just to let the code smaller to post
and this dont make difference to show what I want.

please if dont have patience just let me without your help.

I just though I would find some help on it.

And sorry if I made your day more bad.
Jun 27 '08 #4
Thank you very very much

I really appreciate your help
See http://www.positioniseverything.net/...ed-margin.html
I will take a look on this link
Jun 27 '08 #5
Andy Dingley
Whats your problem?
Are you angry?

If I have asked for help is cause I dont know how to do what I need.

Could you undestand it?

I dont put head e title element just to let the code smaller to post
and this dont make difference to show what I want.

please if dont have patience just let me without your help.

I just though I would find some help on it.

And sorry if I made your day more bad.
Jun 27 '08 #6

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

Similar topics

6
by: TJ | last post by:
I've got a calendar that is based on the concept of lots of blocks that are spans with float:left. I would like to be able to have a detail section on the right side of the screen, so that when...
1
by: Chris Pudney | last post by:
G'day, I am using CSS to construct bar charts from nested DIVs. In general this works fine. However, in certain circumstances I need to display multiple charts inline. To get consistent results...
7
by: Alex | last post by:
Hi Everone, I need some advice on how to setup 4 columns where the outside two are absolute (120px) and the inner two (side by side) are relevent (Fluid) and change with the screen. Here's my...
0
by: jonipony | last post by:
HELP: Float Left box is drifting to the right in ie! -------------------------- I need som HELP with my CSS coding! On the following web page my design falls apart at screen size 800 x 600...
5
by: Timeri | last post by:
This is a bit confusing until you actually see what I'm talking about but the main content of my page is not growing with the right column. I want the main content (left/larger column) to take into...
8
by: hzgt9b | last post by:
I am working on a site that is being served to a private network. All the users are using IE6+. I am having trouble getting the 1st div added to a containing div to have its margin-left applied...
4
by: moondaddy | last post by:
I have a wpf project where I use a canvas to drag shapes around. when I drag a shape beyond the right or bottom side I get scrollbars which is good. I also get scrollbars when I zoom in and a...
3
by: Noorain | last post by:
I designed a site. i want to header,footer,left & right column fixed but body information only scrolling. this site screen to be 800/600 px. i designed this way but when i used position fixed all...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.