Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have placed images on Wordpress page templates without any inline style attribute but it seem Wordpress automatically add style tag with width and height set to zero.

<img src="wp-content/themes/ecoblog/images/hiw-image-1.png" style="width: 0px; height: 0px;">

Sometimes height is set to its original dimentsions and sometimes after complete refresh its values are zero.

What is causing this?

share|improve this question

closed as too localized by toscho Dec 20 '12 at 11:09

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
Disable all plugins and switch to TwentyEleven. Does it still happen? –  toscho Dec 19 '12 at 9:45
    
@toscho no it is not happning anymore. Themes's JS file was doing this. –  Azfar Niaz Dec 20 '12 at 10:58
add comment

1 Answer 1

up vote 3 down vote accepted

Before you ask a question: maybe check on a other install of WP, is this the default? It is not? The problem is very often from plugins or themes. Disable plugins and switch to the default theme, current Twenty Twelve and check your problem.

The current release 3.5 and 3.4* have not this insert as default, only the img tag with path and alt attribute.

share|improve this answer
1  
I can confirm, none of my installs do it either, whatevers doing it, it's not standard WP behavior –  Tom J Nowell Dec 19 '12 at 12:12
    
Thanks for reply. It was a problem with themes JS file which tries to maintain aspect ratio of images. Commenting it solves the issue. –  Azfar Niaz Dec 20 '12 at 10:42
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.