Jump to content

Image width and height becomes 1px in IE


cerstrand_mace

Recommended Posts

I've stumbled upon yet another trouble with internet explorer where my images mysteriously becomes 1px by 1px instead of sizing according to it's container like other browsers.I googled the problem and it seems like a lot of people gets this problem when applying heigh:auto; to an image. I accually had this applied but it wasn't solved by removing it.I'll just leave an url for the page here so you can see for yourselves:http://tec.macework.se/catalog/products/components/

 

 

Any clues?

Link to comment
Share on other sites

So I see...

<img width="" height="" alt="Bar ends" src="http://tec.macework.se/wp-content/uploads/2013/11/C2400300-300x300.jpg">

Try deleting those null width and height attributes.

Edited by davej
  • Like 1
Link to comment
Share on other sites

So I see...

<img width="" height="" alt="Bar ends" src="http://tec.macework.se/wp-content/uploads/2013/11/C2400300-300x300.jpg">

Try deleting those null width and height attributes.

 

That accually did the trick! I use Woocommerce and simply enough all I had to do was removing the function inside the template page that gets the dimensions of the thumbnails.

 

Here's the code that I edited in the woocommerce-template.php:

echo '<img src="' . $image . '" alt="' . $category->name . '" width="' . $dimensions['width'] . '" height="' . $dimensions['height'] . '" />';

I changed it to:

echo '<img src="' . $image . '" alt="' . $category->name . '"  />';

Fixed! Thanks :good:

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...