Can I set an image to be Max-Width=100% ?

I have a simple Writer document with an image as a banner. I commonly export the file to both PDF, and HTML, for easy viewing online.

When the document is exported to HTML, the size of the banner is fixed in the outputted HTML. I’ve tried to set the size of the image to be relative instead of fixed, but it still comes out with a set size in the HTML, instead of something responsive.

Is there a way to set the size of the image, in the output, to be max-width:100% ?

What do you want to achieve with max-width:100% ?

max-width do not belong to the valid attributes of the img-element. http://www.w3.org/TR/html5/embedded-content-0.html#the-img-element

Setting a CSS style for “max-width:100%” that applies to a specific image, or even all images, will make the images responsive and shrink to fix on a smaller screen, such as a smartphone. It works well when I add it by hand, I am just looking for a way to set it as a property for the image or document as a whole, so that I do not need to re-update it by hand after each export.

Example is at:

http://www.knightrealms.com/documents/rulebook/knightrealms-rulebook-advanced.html

Setting a CSS style for “max-width:100%” that applies to a specific image, or even all images, will make the images responsive and shrink to fix on a smaller screen, such as a smartphone. It works well when I add it by hand, I am just looking for a way to set it as a property for the image or document as a whole, so that I do not need to re-update it by hand after each export.

Example is at: http://www.knightrealms.com/documents/rulebook/knightrealms-rulebook-advanced.html The image at the top has had “max-width:100%” added to the style manually, and it resizes properly on a phone now.

No there is no way to set max-width attribute. LibreOffice does not support style attribute on img-element. You should look for a better html authoring tool.

Ultimately, HTML is a side benefit, and not the main goal of the document. That being said, I think I have a solution in using a custom export template with Writer2xhtml, which should do the trick - I can add the style to the header on export.