views:

1182

answers:

9

I'm struggling with getting elements to render the same size in Internet Explorer as it does in other browsers. For instance, an image set to 500px wide takes up a significantly larger amount of screen real estate in Internet Explorer as it does in Firefox, Opera, Safari, Chrome, etc.

Can someone explain why 500 pixels takes up a different number of 'real' pixels depending on which browser you're using?

To elaborate, take the following HTML and CSS snippet.

CSS...

#testImg {
    width:500px;
}

HTML...

 <img id="testImg" src="...">

Why does that take up 2.5" of my monitor in Internet Explorer and 2" in other browsers?

A: 

Because IE is not a good browser.

Ricardo Acras
Thats general knowledge, aint it?
Mostlyharmless
and YET is true... I can receive 100 negatives for this. Will not delete it, heheeh
Ricardo Acras
It *is* true, so you won't get a downvote from me. And yet, it's not a very useful answer - so no upvote from me either. Sorry!
Sherm Pendley
No problem! Some negatives (and no positives) worth it when it comes to say it! :-)
Ricardo Acras
It may be true, But I am sure that this is neither the right answer to this question no does it help. IE may be innocent in this case until the opposite is proven.
splattne
for me IE is guilty until the opposite is proven, always
Ricardo Acras
"IE is guilty until the opposite is proven" is the best thing I read today.
some
True but irrelevant to the problem at hand.
Nosredna
+1  A: 

Ehm, you don't have Zoom activated, haven't you? Look at the right bottom corner of the status bar.

splattne
nope. It's at 100%. Driving me mad that the same element takes 2.5" of actual screen space in IE and 2" in everything else.
Matty
+10  A: 

Perhaps your Internet connection is passing through Texas...

Steven A. Lowe
that made me chuckle.
Matty
I laughed...the guy in the next cube just WTFed.
Thomas Owens
EVERYTHING's bigger in Texas...
Dan Esparza
lol - just once though
seanb
Dang, you beat me to it. :)
Nathan Long
A: 

Are you using a Strict doctype?

Joel Coehoorn
Yes XHTML strict
Matty
+2  A: 

Most browsers implement the HTML DOM and CSS differently (though some share a rendering engine, like KHTML/WebKit). IE seems to be the most liberal about the size of a pixel, which is really annoying when you're trying to tune a layout. The situation will hopefully improve with IE8, since Microsoft seems to be making a decent effort to catch up on standards compliance and behavior of other browsers.

Jimmy
is there any way to 'trick' IE into changing it's interpertaion of how big a pixel is?
Matty
+4  A: 

A tip: try to load the picture URL alone in Internet Explorer. If it is the same as in other browsers it must be a HTML/CSS issue, that IE renders differently.

splattne
Good tip. Tried this and the images are definitely very different in size.
Matty
Mysterious. Is the image being created dynamically?
splattne
A: 

Maybe you do some CSS image scaling as described in this tutorial: CSS Scale Image Html Tutorial?

splattne
+12  A: 

It is probably related to your DPI setting of your windows desktop.

See this article http://msdn.microsoft.com/en-us/library/cc849094.aspx on the subject.

EDIT:

Excert from article:

"Scaling the Web

By default, Internet Explorer 8 will zoom the content of a Web page to match your Windows DPI Scaling settings. (This is a change from Internet Explorer 7, which did not zoom to match Windows DPI Scaling settings.) For example, if you set the DPI Scaling to 120 DPI, Internet Explorer 8 will zoom the content of a Web page by 125%, because scaling is done relative to 96 DPI, and 120/96 equals 1.25, or 125%. This is reflected in the Zoom UI in the bottom-right corner of the browser window:"

Soraz
I'm browsing right now on my TV with 120dpi, but I get not bigger images in IE than in Chrome for example.
splattne
That did it! Thanks very much
Matty
I tried this on my PC but with IE7 - pcitures were the same. Didn't you (thespothexperiment.blogspot.com) say you were using IE7?
splattne
Yes IE7. Changed Windows > Display Properties > Settings > Advanced (button) > General Tab > DPI Setting from 120DPI to 96 DPI.Rebooted windows and everything is the size I expected now.
Matty
I had a visually impaired user complain a site was "all over the place" because of this. Changed the DPI and zoomed on the brower instead. It was much better.
Diodeus
A: 

Did you try CTRL+SHIFT+0 to default on the default size?

labilbe