Jump to content
Sign in to follow this  
cerstrand_mace

Image width and height becomes 1px in IE

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?

Share this post


Link to post
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

Share this post


Link to post
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:

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...