Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 20th, 2005, 09:24 PM
Alex Bell
Guest
 
Posts: n/a
Default MSIE Windows fudge - why?

width: 50%; /* ie5win fudge begins */
voice-family: "\"}\"";
voice-family:inherit;
width: 46%;

I've seen this fragment several times in various layout examples.
What does it mean, and why is it necessary?

Regards, Alex
  #2  
Old July 20th, 2005, 09:24 PM
Steve Pugh
Guest
 
Posts: n/a
Default Re: MSIE Windows fudge - why?

Alex Bell <abell1@tassie.net.au> wrote:
[color=blue]
>width: 50%; /* ie5win fudge begins */
> voice-family: "\"}\"";
> voice-family:inherit;
> width: 46%;
>
>I've seen this fragment several times in various layout examples.
>What does it mean, and why is it necessary?[/color]

http://www.tantek.com/CSS/Examples/boxmodelhack.html

IE gets the CSS box model wrong. In CSS when a width is specified this
is the width of the content, and any padding, borders and margin is
added to that width. But in IE the value given to the width is border
to border, with only margin added in addition to it.

But IE has a bug whereby it can't parse certain CSS comments properly,
so in the above example IE sees the 50% width but not the 46% width.
So different browsers apply different widths, which when combined with
the different box models should give identical final appearances.

However, IE in the above applies to versions up to IE5.5.
IE6 (and Mac IE5 and also Opera 7) can apply either the broken box
model or the correct one depending on which doctype is used in the
document. These browsers are also not fooled by the above trick. So,
only use the above hack if you also use a doctype that pushes those
browsers into Standards mode.

See also:
http://www.hut.fi/~hsivonen/doctype.html
http://centricle.com/ref/css/filters/

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <steve@pugh.net> <http://steve.pugh.net/>
  #3  
Old July 20th, 2005, 09:24 PM
Alex Bell
Guest
 
Posts: n/a
Default Re: MSIE Windows fudge - why?

On Mon, 29 Sep 2003 09:20:16 +0100, Steve Pugh <steve@pugh.net> wrote:
[color=blue]
>Alex Bell <abell1@tassie.net.au> wrote:
>[color=green]
>>width: 50%; /* ie5win fudge begins */
>> voice-family: "\"}\"";
>> voice-family:inherit;
>> width: 46%;
>>
>>I've seen this fragment several times in various layout examples.
>>What does it mean, and why is it necessary?[/color]
>
>http://www.tantek.com/CSS/Examples/boxmodelhack.html
>
>IE gets the CSS box model wrong. In CSS when a width is specified this
>is the width of the content, and any padding, borders and margin is
>added to that width. But in IE the value given to the width is border
>to border, with only margin added in addition to it.
>
>But IE has a bug whereby it can't parse certain CSS comments properly,
>so in the above example IE sees the 50% width but not the 46% width.
>So different browsers apply different widths, which when combined with
>the different box models should give identical final appearances.
>
>However, IE in the above applies to versions up to IE5.5.
>IE6 (and Mac IE5 and also Opera 7) can apply either the broken box
>model or the correct one depending on which doctype is used in the
>document. These browsers are also not fooled by the above trick. So,
>only use the above hack if you also use a doctype that pushes those
>browsers into Standards mode.
>
>See also:
>http://www.hut.fi/~hsivonen/doctype.html
>http://centricle.com/ref/css/filters/
>
> Steve[/color]
Thanks, Steve, that gives me something to think about.

Regards. Alex

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles