Farig Sadeque
Farig Sadeque

Reputation: 25

image scaling is not working in internet explorer

I am working on a simple HTML website, and faced a problem. Logos like Twitter or LinkedIn are not being scaled in Internet Explorer (it is the latest version)-- but other browsers work fine. Here is a fragment of my code:

<td>&nbsp;<a target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&url=<;url>">
<img src="images/linkedin.gif" height="28" width="28" border="0"/>

What can I do to scale those images in Internet Explorer?

Upvotes: 0

Views: 2483

Answers (2)

Daniel Baum
Daniel Baum

Reputation: 11

At least when working with HTML5, I found that Internet Explorer seems to interpret width and height parameters on the img tag as crop sizes. To get a properly scaled image, you need to enclose it in a figure tag like this:

<figure style="width: 28; height: 28; margin: 0">
    <img src="images/linkedin.gif" style="max-width: 100%; max-height: 100%"/>
</figure>

This will also work fine in other browsers.

Upvotes: 1

Sahil Popli
Sahil Popli

Reputation: 1995

try <img src="images/linkedin.gif" style="height:28px; width:28px; border:none;"/>

and if this fails try adding !important behind all styles

may be something overrides your style

Upvotes: 1

Related Questions