I'm using contentEditable to allow rich text editing in my app. I don't know how it slips through* but when an image is inserted, and then resize (by dragging the anchors on its side), it generates something like this:
< img style="width:55px;height:55px"
width="100px" height="100px"
src="pic.gif" border=0>
(subsequent testing shown that inserted images did not contain this "rogue" style param).
when rendered by the browser (IE7), the width and height in the style overrides the img width/height param (so the image is shown like how I wanted it.. resized to 55px x 55px. So everything went well so it seems.
When I output the page to a ms-word document via setting the mime type application/msword / or pasting the browser rendering to msword document, all the images reverted back to its default size. I finally found out that msword is discarding the style and using the img width and height tag (which has the value of the original image size).
Took me a while to found this out. Anyway... I've coded a javascript function to traverse all tags and "transferring" the img style.width and style.height values into the img.width and img.height, then clearing both the values in style, before I proceed saving this piece of html/richtext data into the database.
cheers.
opps.. my answer is.. no. leave both attributes directly under img, rather than style.