Forum Moderators: not2easy

Message Too Old, No Replies

Define width and Margin in IE6, IE5.5

How to specify width and margin for IE6 and IE5.5

         

samu12

7:17 am on May 27, 2008 (gmt 0)

10+ Year Member



Dear All,

Greetings!
Again back to this wonderful forum that I have been receing so much information on CSS. Now, I have few things to ask.

I am working on a web. This is OK in IE7, Mozilla and Camino
BUT problems in IE6, IE5.5.

- Basically how we define width for IE
- How define margin in IE, so that looks on IE6, IE5.5 and other browser be compatiable.

Waiting your reply. Most of the time makes me problem due to IE box model.

Thanks all for your help
Sheru

Setek

12:51 am on May 28, 2008 (gmt 0)

10+ Year Member



There are two ways to achieve this from what I know, both are a bit fiddly and crap...

1. Conditional Comments
For every width you set that has padding applied also, you have an alternative width in a conditional comment for IE 5.5 and IE 6.

2. Workaround
For every element you have that has a width, you have an element either within or surrounding that element that has the padding applied, but not a width. This will mean all the same values for all browsers, but requires superfluous code.

As you can probably tell, both of those options require a fair amount of work. Instead, what I personally would do, is:

  1. Set a full and correct doctype, so IE 6 does not go into quirks, and uses a more standard box model (I do not dare to call it "the standard box model") and your widths and paddings will be fine
  2. Give up on IE 5.5

Hope that helps :)

samu12

3:41 am on May 28, 2008 (gmt 0)

10+ Year Member



Hi Setek,
Thank you for your information and Help. Appreciate you for your great time. I will keep in touch.

Thank you
Sheru

samu12

8:21 am on Jun 4, 2008 (gmt 0)

10+ Year Member



Greetings,
I am having big problem on IE6. my content box goes down which is unusual. Samething with IE 7 and other browsers like camino and mozilla is all OK. Now how can I fix this one problem?

Especially, I want to ask How to specify different width for IE6 and IE7?

Thank you
Sheru

swa66

8:06 pm on Jun 4, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try this:

<link rel="stylesheet" type="text/css" href="/style.css" />
<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="/fixie6.css" />
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="/fixie7.css" />
<![endif]-->

For standards compliant browsers, that's just the style.css, the rest are two comments.
IE 6 will add fixie6.css on top of the style.css
IE 7 will add fixie7.css on top of the style.css

IE8 is forced by this to use the standards compliant stuff (not to give MSFT any excuse of not making it 100% compliant, by feeding it bugfixes for their abandoned browsers)