[wp-hackers] wp-hackers Digest, Vol 67, Issue 54
otto at ottodestruct.com
Mon Aug 16 15:27:51 UTC 2010
On Mon, Aug 16, 2010 at 7:13 AM, Ryan Hellyer <ryan at pixopoint.com> wrote:
>> Well, my point is that if WP was doing the right thing here and using
>> inline styles, then it wouldn't matter what the theme did. Inline
>> styles always win.
> Huh? WordPress does use inline styles. It adds them to the IMG tag as
> it should do. The theme is over-riding that which it shouldn't be
WordPress isn't using "inline styles", it's using HTML attributes.
These are two different things.
>> Stylesheets control the presentation, after all. In this
>> case, the height and width of "auto" is merely expressing the default
>> settings, and normally it'd be the correct way to do it.
> No it isn't. The correct height and width is what is specified on the
> IMG tags. The CSS is over-riding that and applying auto, which is the
> width of the image itself.
The theme *cannot* override inline styles, unless it's using
!important (it's not). However, any CSS will override HTML attributes,
which are notably not styles.
Basically, what I'm saying is that the resize code should produce this:
<img src="whatever" width="123" height="123" style="width:123px;
Right now it's not producing that "style" parameter. If it was, then
the width and height declarations in the theme wouldn't make any
difference at all.
More information about the wp-hackers