[wp-hackers] TwentyTen Theme issue

Ryan Hellyer ryan at pixopoint.com
Tue Aug 17 02:09:58 UTC 2010


> Yes, yes, lots of people use it that way. Still wrong because CSS
> takes precedence over those attributes. We should fix WP to do the
> right thing here, I'd say. Should be simple enough to do, really.
>
> -Otto

Thanks Otto.

I should have thought this through more before posting. What you wrote
was correct, I just misunderstood and hadn't realised the benefits of
adding height:auto (hat tip to Ian Stewart for pointing me in the
right direction).

Adding height:auto in the CSS should allow the images to resize
proportionately when a max-width is used. This breaks when the image
is a different size to that specified in the HTML unfortunately. So if
you have a giant over-sized image displayed via Twenty Ten, it will
resize correctly rather than becoming distorted. The width:auto is a
hack for IE apparently.

There are disadvantages to this obviously, as it means that the IMG
tag widths and heights are effectively ignored, however if the admin
panel was setup to resize the image files rather than just the IMG tag
widths and heights then the problem would be solved for those who are
most likely to be confused by the situation and not able to solve it
themselves (ie: non-coders who aren't editing their own HTML via the
code editor).

Ian Stewart said he is looking into this and there will be a diff.
submitted for 3.1 to help alleviate these problems.

cheers,
Ryan


More information about the wp-hackers mailing list