Box model and IE

D

David Graham

Hi
I have been to a website were I got the following advice

"Borders and Margins are supposed to be measured *outside* the box. IE 5.x
for Windows messes this up by saying that if you have a 500 x 200 box, and
you add 10px padding, 10px margin, and 2px border, the content inside will
only have 458x158 to squeeze into"


I think the margin is irrelevant - IE 5.x puts the border and padding within
the box, therefore the available space for the content would be:

500 - 2(- 10 -2) = 500 - 24 = 476px width

200 - 2(-10 -2) = 200 - 24 = 176px height

Do I have this correct, or do I need to think again about this issue

thanks
David
 
S

Steve Pugh

David Graham said:
I have been to a website were I got the following advice

"Borders and Margins are supposed to be measured *outside* the box. IE 5.x
for Windows messes this up by saying that if you have a 500 x 200 box, and
you add 10px padding, 10px margin, and 2px border, the content inside will
only have 458x158 to squeeze into"

I think the margin is irrelevant - IE 5.x puts the border and padding within
the box, therefore the available space for the content would be:

500 - 2(- 10 -2) = 500 - 24 = 476px width

200 - 2(-10 -2) = 200 - 24 = 176px height

Do I have this correct, or do I need to think again about this issue

That's correct. Windows IE 4 - 5.5 (and 6 in quirks mode) includes
padding and border inside the width but not margin.

Steve
 
D

David Graham

Steve Pugh said:
That's correct. Windows IE 4 - 5.5 (and 6 in quirks mode) includes
padding and border inside the width but not margin.

Steve

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

Steve Pugh <[email protected]> <http://steve.pugh.net/>

Thanks Steve - I thought I was correct but it helps to have it confirmed. I
will go back to Ryan Parman and tell him. He is the guy offering mutiple IE
installation. I'm surprised that such a clued up person should make such a
fundermental gaff. I can't even see how he come up with his figures, he has
subtracted 42 for some reason.
thanks
David

thanks
David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,163
Latest member
Sasha15427
Top